High Memory usage but not seen by unix tools

christophe January 21, 2013

Using Jira v5.1 under SUSE Linux with mySQL running on the same server
JVM memory options : JAVA_OPTS="${JAVA_OPTS} -Xms2G -Xmx2G"
Lastest Java Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
Tomcat
Around 500 registered users
~ half of them currently logged

We experience high total unix memory usage

Free command result (reformated for easy reading)

Before we start our tomcat running only Jira (mySQL started)
Mem : total 8'889'816 ; used 1'546'856 free 7'342'960
After we have fully started Jira
Mem : total 8'889'816 ; used 80846856 free 429'60

The "top" command reports

tomcat VIRT = 3038m RES =2.5g
mysql VIRT = 339m RES=41m

So the top commands tell me that 3038m is used by tomcat/Jira but the free command tells me that
4'304'960 has vanished somewhere !
And I can't regain those 4Gb even when I stop tomcat process

Any Idea ?
Is jira natively using system to allocate some memory external to the JVM ?
Is Jira loading a lot of native libraries ?

2 answers

1 accepted

0 votes
Answer accepted
christophe January 24, 2013

The Problem was in WMWare !

  • WMWare was not giving to Linux the RAM asked
  • Under linux the total RAM was reported there
  • But a non seen process was locking it
  • Instead of using real physical RAM Linux was swapping !
    It didn't know it
    So we add VERY high CPU usage and no reported Swap

1 vote
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2013

http://www.linuxatemyram.com/

In short - this is normal. The memory is used for caching files like the lucene indexes, classes etc. It's not shown as free but it is "available".

Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2013
Cached memory in Linux means, AFAIK, it was accessed and mapped to page tables, then released by the app and available quickly when demanded.
christophe January 21, 2013

Thanks for you answer
I have read the http://www.linuxatemyram.com/
I knew already the -/+ buffers/cache
free reportes me 350'220
which is pretty low regarding my 9Gb of total memory

christophe January 21, 2013

Thanks for you answer
I have read the http://www.linuxatemyram.com/
I knew already the -/+ buffers/cache
free reportes me 350'220 : 350kb is pretty low
Pretty low regarding my 9Gb of total memory

Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2013

Christophe,

If memory "vanishes" it is because something claimed it. I would do as root a "ps -adef | grep java" and I would see if there's no zombie tomcat process around (or whatever).

And, for 500 users total 2Gb as heap is excessive anyway.

christophe January 21, 2013

Dear Radu : only one process the tomcat one

Radu Dumitriu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 21, 2013

pmap -d <PID>, look at the last line:

mapped: - total amount of memory mapped to files

writeable/private: - the amount of private address space

shared: - the amount of address space this process is sharing with others

Suggest an answer

Log in or Sign up to answer