File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

garbage collection

 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5782
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic