Link Details

Link 42591 thumbnail
User 111696 avatar

By bloid
via blogs.oracle.com
Published: Sep 18 2007 / 14:41

Memory Leaks? We have a Garbage Collector! True. Java comes with a Garbage Collector and makes reclaiming of heap space easier. On the other hand, Java offers a number of features, which, if used carelessly, can be the root for your memory leak nightmares.
  • 10
  • 2
  • 2280
  • 891

Comments

Add your comment
User 191349 avatar

raveman replied ago:

0 votes Vote down Vote up Reply

wtf? we should worry when we use inner classes or anonymous inner classes ? i always said that OOP is stupid.

User 184684 avatar

kdavies replied ago:

0 votes Vote down Vote up Reply

This is dumb. Anytime you are do a cache you have to be careful, whether you are using an inner class or not. Even if you are using an ordinary object in a cache it keeps references to all the objects in it fields so they won't be garbaged collected. If you cache an object you keep an object and all the things it refers to in memory. That is the whole point of the cache.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (10)



Voters Against This Link (2)