On Thu, Apr 2, 2009 at 9:33 AM, Mark Perry <[email protected]> wrote:

> JAVA JVMs like real storage :-)

> The Garbage Collection (GC) runs periodically and references ALL JVM
> allocated storage. If Linux has paged out any of the JVM storage it must
> be brought back in for every GC cycle. This can be annoying if the JVM
> is not really using all of its allocated storage!

That indeed confirms my assumption that the JVM uses "in-band"
controls to manage the heap. Rather unattractive with virtualization
because it increases the footprint of the management process a lot
(you need to touch the objects to manage them). It's not without
reason we have book titles printed on the spine: to reduce overhead of
browsing the shelf...

> There are 2 parms for the JVM:
>
>    -Xms<size>        Set initial Java heap size
>    -Xmx<size>        Set maximum Java heap size
>
> If you set the first one low (Xms) then the JVM will release unused
> memory down to this value, which is useful if you need the page frames
> for other tasks. GC will only reference the allocated storage, which
> could drop to this minimum value.

Popular recommendation however (not mine) is to set them equal so GC
does not waste resources moving things in the corner to free a buffer,
and then get it back immediately after. I thought you could avoid that
by creating some hysteresis with the "increment" settings. It probably
depends a lot on the variation in memory requirement during the day.

> swappiness is a control on how many *free* page frames linux is going to
> try an keep - if necessary by periodically paging some pages out.

I'd rather say it steers Linux in *how* to free pages when needed,
whether by dropping cached data or bring portions to swap space.

> So if you are going to have a higher value for swappiness and run java,
> consider the above.

Certainly. It creates that 2nd layer of memory management that
interferes with the first layer.
Having two managers is not better than having just one; it's worse! ;-)

Rob
-- 
Rob van der Heij
Velocity Software
http://www.velocitysoftware.com/

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to