This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Another garbage collection! Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Another garbage collection!" Watch "Another garbage collection!" New topic
Author

Another garbage collection!

laura_zpf
Ranch Hand

Joined: Sep 14, 2000
Posts: 30
Is the statement true or false?
Garbage Collection feature of Java ensures that the program never runs out of memory.
I think it is right. But the answer shows me that is wrong.
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 2912
No system in this world can ensure that the porgram will never run out of memory!!! Memory is always limited.
This is what happened with us in a project that I worked on. We did not know that the GC never collects the Strings. We were creating huge XML String messages in our application and every 2-3 hr we were running out of memory. That's when we realized our fault and changed our program to use StringBuffers instead.
Anyway, the answer to you question is, if you create huge objects and don't release their references, you'll run out of memory for sure. No GC can fix that.
HTH,
-Paul.
------------------
Get Certified, Guaranteed!
http://pages.about.com/jqplus


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Another garbage collection!
 
Similar Threads
gc ??
Tech Word Game
Return values of methods
i passed with 81%
what is the difference between local garbage collection and remote garbage collection