[Gc] Re: The difference when setting initial-heap-size and not?

Martin Egholm Nielsen martin at egholm-nielsen.dk
Fri Feb 3 02:48:26 PST 2006


> The number of blocks in use is the number of heap chunks (usually pages)
> on which any live objects reside.  The reported number of bytes is the
> number of bytes in those blocks.  If you only had small objects, this
> will be the number of blocks times the block size (probably 4K).  Large
> objects reside in larger "blocks", so the number of bytes will typically
> be a bit larger than that.
> 
> The collector versions used in gcj (i.e. versions < 7) don't calculate
> the actual amount of live memory unless you recompile the collector
> without the -DSILENT flag.  In that case, additional counting code is
> compiled in.  (You do not want to do this for production code.  It will
> slow down the marker, especially if you enable parallel marking, which
> admittedly isn't likely here.)  But it would be interesting to see the
> output here for debugging purposes.
But I assume the collector considers those blocks as occupied, and not 
useful for future allocations?
So setting initial heap size will likely result in a more "fragmented" 
heap due to this!?

> My guess is that your results are normal.  With a larger heap size,
> small objects are distributed over more pages in the heap.
Oki, thanks! I was just wondering - now I know!

// Martin

> 
> 
>>-----Original Message-----
>>From: gc-bounces at napali.hpl.hp.com 
>>[mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Martin 
>>Egholm Nielsen
>>Sent: Thursday, February 02, 2006 6:20 AM
>>To: gc at napali.hpl.hp.com
>>Subject: [Gc] The difference when setting initial-heap-size and not?
>>
>>
>>Hi,
>>
>>I know I'm jumping all around the scene now, but in the attempt do 
>>produce GC-dumps for my other news thread I discovered 
>>something I found 
>>peculiar.
>>When starting my application without an initial heap size, but with a 
>>maximum heap size, I end up in a steady state with:
>>
>>***Blocks in use:
>>--- 8< ---
>>blocks = 887, bytes = 3801088
>>
>>However, if I specify an initial heap size of 14megs, the resulting 
>>steady state says:
>>
>>***Blocks in use:
>>--- 8< ---
>>blocks = 1499, bytes = 6307840
>>
>>There is no difference between the resulting steady states over 
>>different runs, and it's reproducable.
>>
>>Maybe I just don't understand the concept "Blocks in use", 
>>but as I read 
>>it, it indicates the amount of memory actually being referred 
>>to by my 
>>application.
>>Am I all wrong?
>>
>>BR,
>>  Martin
> 
> 



More information about the Gc mailing list