Meaningless Drivel is fun!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes problem in garbage collector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "problem in garbage collector" Watch "problem in garbage collector" New topic
Author

problem in garbage collector

giribabu rosi
Greenhorn

Joined: Apr 14, 2005
Posts: 17
when te object is eligible or Garbage collection

1.it is autmatically collected.

2.Why in questions they are asking how many objects are eligible for collection??
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11170
    
  16

When an object is elligible for garbage collection, it MIGHT be collected at some point, but you never know if or when. It's possible that the program could run for years, and if memory never becomes an issue, that object will not be GC'd.

The best you can do is make the call to suggest the JVM do a GC, but it's only a suggestion. The JVM is free to ignore, and often does, the suggestion.

Why do they ask how many objects are elligible? to see if you understand garbage collection. Why else?
[ May 25, 2005: Message edited by: fred rosenberger ]

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in garbage collector
 
Similar Threads
Question of garbage collection
Garbage Collection doubt
Question on Garbage Collection
Garbage collection
how many objects eligible for GC?