Interview Questions  

Go Back   Interview Questions > Interview Questions & Answers > Information Technology > Java > Core Java

Core Java Core Java Interview Questions, Learn by sharing Core Java Interview Questions asked in various companies, Get Career advices, Interview Procedures from Core Java experts, Post asked Core Java Interview Questions and Answers.

   

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-24-2008, 01:06 PM
Member
 
Join Date: Jul 2008
Location: West Bengal,India
Posts: 48
Default When does the Garbage Collection happen?

When does the Garbage Collection happen?
__________________
Asit Kumar Purohit.
SRIC,IIT Kharagpur.
West Bengal,India
Mail me
Reply With Quote
  #2 (permalink)  
Old 07-30-2008, 09:53 AM
Junior Member
 
Join Date: Jul 2008
Posts: 1
Default

garbage collection happens when jvm finds that any methods or variables declared but does not have any action and kept dummy then garbage is invoked..
only jvm decides when to collect garbage we can not instruct jvm..
the main thing is garbage collection is also a destructor in java.. it frees memory..
Reply With Quote
  #3 (permalink)  
Old 08-01-2008, 07:31 AM
Junior Member
 
Join Date: Aug 2008
Location: noida
Posts: 7
Default Garbage collector

garbage collector(gc) is a Daemon thread that runs on the sake of jvm. gc is called, not only wen jvm required memory but also any random time assigned by java manager thread. nobody knows wen gc will be called. u can also call gc method( System.gc()) for the request of garbage collection but remember, this is just a explicit request but not the order.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On