Rob van der Heij wrote:
> On Thu, Apr 2, 2009 at 8:15 AM, Shane Ginnane <[email protected]> wrote:
>
>> This is an indication of preference only - in a stress situation your
>> input will be ignored. Well it should be - I have trouble explaining what
>> Marcy saw at the setting of 60.
>
> My opinion* is that the two memory management algorithms interfere.
> There's probably Java code implementing various type of data cache
> classes in the JVM heap, likely on LRU basis. Linux will select
> candidates for swap-out also on LRU basis. This typically results in
> worst case scenario where the page selected for swap-out is the next
> one to be re-used by the application. When the page is re-used, the
> swap splot remains assigned until another swap-out for that page
> happens.
> So when this popular part of application memory just does not fit in
> what Linux set aside for it, you will see it over time cycle through.
> Resulting in every page eventually having a slot assigned in swap
> space. So it fills up swap space.
>
> When she lowered swappiness enough, it shifted the base line and left
> enough room for the popular part of the application without swap out
> the least recently used pages all the time. So it did not allocate all
> these swap slots and did not fill up swap space.
>
> *opinion: My best guess of what happened without measurements to prove it
>
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!
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.
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.
So if you are going to have a higher value for swappiness and run java,
consider the above.
mark
----------------------------------------------------------------------
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