Discussion Board
There are no previous messagesGo to the following message
Current Forum: Homework 5 - Part 3
Date: Tue Nov 20 2001 2:21 am
Author: Cipriani, Jason A. <jac4@andrew.cmu.edu>
Subject: garbage collection

let's say i have an object called HugeObject that takes up a lot of memory. when i _know_ that i am done with it, and that my program does not reference it any more, can i gain more control over freeing it's associated memory by doing:
HugeObject huge = new HugeObject();
// do things with huge ...

// ... later in program
huge = null;
System.gc();
does the garbage collector _always_ run as soon as possible? or do i need to give it a swift kick in the ass by calling System.gc() to do a forced recycling of no-longer-needed memory blocks?

thanks,
jason

Post response

There are no previous messagesGo to the following message
Current Thread Detail:
garbage collection      Cipriani, Jason A.      Tue Nov 20 2001 2:21 am       
Re: garbage collection      Lee, Peter      Tue Nov 20 2001 3:41 pm       
Re: garbage collection      Cipriani, Jason A.      Tue Nov 20 2001 3:58 pm       
Re: garbage collection      Lee, Peter      Wed Nov 21 2001 10:33 am       
Re: garbage collection      Scherer, Sebastian      Tue Nov 20 2001 4:24 pm       
Re: garbage collection      Lee, Peter      Wed Nov 21 2001 10:35 am       

Back to previous screen