Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Memory and Tags

 
martin samm
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got some custom tags and have noticed, using JProbe that they seem to 'hang around' in memory for a long time, but do get cleared on requesting Garbage collection.
Any ideas what could be causing this?
 
Brent Worden
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More than likely the container is caching the tags in memory for quick access. This would explain their long lifetimes.
Furthermore, they're probably being cached using a soft or weak reference (see the java.lang.ref package) which allows objects to be finalized and gc'd eventhough there are still references to the object. This would explain why they are reclaimed during gc.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!