Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Terminate garbage collector.  RSS feed

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

who will terminate the garbage collector ?


 
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
 
Marshal
Posts: 58363
178
  • 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 ?
 
Java Cowboy
Sheriff
Posts: 16082
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 ,
 
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: 58363
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch , Siva Arun
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!