• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can a JVM not following Java specification should be called "J"VM?  RSS feed

 
Prasanna Kulkarni
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My friend had following conversation during interview:

Interviewer: Can garbage collection be forced.
My Friend: No, it can not, its a low priority thread and ...We are never sure when it will run.
Interviewer: Yes gc can be forced, If we write a JVM which runs gc thread on definite intervals then we are sure it'll run for sure, and we can force according to timer.

Now, I dont know what the interviewer meant exactly but I think doing something like that will be like not following Java specification so that VM can not be called as "J"VM on the first place.

Any comments? Am I wrong?
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Prasanna Kulkarni:
Hi,

My friend had following conversation during interview:

Interviewer: Can garbage collection be forced.
My Friend: No, it can not, its a low priority thread and ...We are never sure when it will run.
Interviewer: Yes gc can be forced, If we write a JVM which runs gc thread on definite intervals then we are sure it'll run for sure, and we can force according to timer.

Now, I dont know what the interviewer meant exactly but I think doing something like that will be like not following Java specification so that VM can not be called as "J"VM on the first place.

Any comments? Am I wrong?


The interviewer is trying to be clever, but fails miserably.
Strange how the agenda is for the opposite to occur, that the "interviewee" is the one who should be trying to be clever.

The interviewer is exploiting commonly held understanding that garbage collection cannot be forced through the API specification, which holds true (unless you change the definition/axiom to suit). Unfortunately, the interviewer did not prove that anything at all was false, only that garbage collection may be deterministic. That is, you are able to write a deterministic garbage collector for a spec. compliant VM. Now that's pretty silly - providing an argument that doesn't even touch on the point at hand.

What's even more sillier? All garbage collectors are deterministic; that the not-so-clever interviewer thinks that by simplifying the complexity of the collection algorithm to make predictions about the garbage collector somehow validates the argument that garbage collectors are deterministic, is further evidence of lack of sense.

Conclusion: a broken assertion on many levels, while also trying to look clever (speculation). Welcome to the monkey cage
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!