aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes garbage collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "garbage collection " Watch "garbage collection " New topic
Author

garbage collection

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi all,
I came across this question in a mock exam .
Which statements about garbage collection are true?
Select all valid answers.
a)You can directly free the memory allocated by an object.
b)You can directly run the garbage collector whenever you want to.
c)The garbage collector informs your object when it is about to be garbage collected.
d)The garbage collector reclaims an object´┐Żs memory as soon as it becomes a candidate for garbage collection.
e)The garbage collector runs in low-memory situations
They say that the answer is b,c,e.
but my questions are
1)can we run it directly. i think we can only make a suggestion.
2)"gc runs under low memory situations". Is it compulsory. What I mean is that it may not get to run under those situations also.
what do you say on this question.
Thanks,
Praveen
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Praveen,
I just did a quick search on this topic and found this question has been discussed here before more than once. Please see the following discussion threads...
Discussion 1
Discussion 2
Discussion 3

Ofcourse, you can always come back and ask for more..
Good luck,
Ajith


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: garbage collection