• Post Reply Bookmark Topic Watch Topic
  • New Topic

Terminate garbage collector.  RSS feed

 
karimkhan pathan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

who will terminate the garbage collector ?


 
Christian Dillinger
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why should you want to terminate the GC?
 
karimkhan pathan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After completing the garbage collection who will be responsible for garbage collector to terminate


This was asked by the interviewer
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what did you answer?
 
karimkhan pathan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I answered JVM ,but he was not convinced . so i want to ask you guys
 
karimkhan pathan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the answer correct ?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is a bit strange. The garbage collector is part of the JVM. Exactly how the garbage collector works depends on the particular implementation of the JVM you are using. As a Java programmer, you normally do not need to be concerned with the exact inner workings of the JVM. You can't really answer this question, unless you studied the internals and source code of a particular implementation of the JVM.

I wonder if the interviewer meant something different, or if the question was just to test out how you deal with difficult questions.
 
karimkhan pathan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks jasper ,
 
Siva Arun
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The below option can be used to disable class garbage collection.

 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch , Siva Arun
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!