Re: Memory utilization

Randall R Schulz <[email protected]> Wed, 30 Jan 2008 17:27:56 -0800
Newsgroups gmane.comp.windows.devel.java.advanced
Message-ID <[email protected]>
On Wednesday 30 January 2008 17:06, Endre Stølsvik wrote:
> Avinash Lakshman wrote:
> > ...
>
> Try with a couple of System.gc()'s  before checking memory from
> within the JVM, and then going into some sleep and checking the
> memory as observed from the OS (do e.g. 10 GCs in a row - more than
> one actually makes a difference sometimes - might be finalization and
> stuff?).

Invoking System.gc() only enqueues a request to perform garbage 
collection activities. GC activity has its own thread, so something 
must ensue to allow the memory management thread to run before any 
actual consequences of the call to become manifest. I doubt calling it 
multiply is of any consequence. Perhaps java.lang.Thread.yield() would 
achieve this, but I'm not an expert on thread programming, so I don't 
really know if this is true or not.


> ...
>
> Endre.


Randall Schulz

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com