Java Memory Leak Cause

Here are the typical cause of Java Memory Leak:

  1. Do not close DB, file, socket, JMS resources and other external resources properly
  2. Do not close resources properly when an exception is thrown
  3. Keep adding objects to a cache or a hash map without expiring the old one
  4. Do not implement the hash and equal function correctly for the key to a cache
  5. Session data is too large
  6. Leak in third party library or the application server
  7. Bugs in the JDK
  8. In an infinite application code loop
  9. Leaking memory in the native code
Your rating: None Average: 5 (1 vote)