aspose file tools
The moose likes Java in General and the fly likes garbage collections Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "garbage collections" Watch "garbage collections" New topic
Author

garbage collections

Ripan Karmakar
Greenhorn

Joined: Jul 28, 2004
Posts: 16
in an interview one question is asked to me but dn't answered properly
plz send the coorect one with explanation
the question was:
"How garbage collection is done in Java compiler ?"

regards


"Strenght is Life and Weakness is Death"<br />Java/J2EE Developer<br />UshaComm Pvt. Ltd, Kolkata, INDIA
Pat Hays
Ranch Hand

Joined: Aug 20, 2004
Posts: 138
In my understanding, if a object in you program is on longer pointed by any variables, this object will be released automatically by Java garbage collection.


Download Java GUI Builder, <a href="http://www.mars3000.com" target="_blank" rel="nofollow">http://www.mars3000.com</a>
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Garbage collection isn't done by the compiler, but by the jvm.

If it was done by the compiler, all our nice programs would go to the trashcan perhaps ?


http://home.arcor.de/hirnstrom/bewerbung
Nick George
Ranch Hand

Joined: Apr 04, 2004
Posts: 815
either that or our really bad ones. If you try to compile some truly horrendous code, the garbage collector gets it.


I've heard it takes forever to grow a woman from the ground
Julian Kennedy
Ranch Hand

Joined: Aug 02, 2004
Posts: 823
Is this actually a question about some nuance of javac and how garbage collection is performed while compiling or just a misguided query as previous responses suggest? I understand that Sun's javac is implemented in Java so it must run in a JVM. I would expect it to run the same way as any other Java program, with a separate GC thread. However, it wouldn't surprise me if it operated differently somehow in some subtle way that would have no impact on 99% of us. Even if that were the case my gut reaction is to ask why would I care? Code gets compilied, garbage gets collected, what more is there to know?

Jules
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: garbage collections
 
Similar Threads
How many eligible for GC?
String literals and garbage collector
finalize method
gc question
garbage collection