Stefan
Stefan

Reputation: 2068

Java application running as jsvc uses more memory than Heap+PermGen

i have the following server:

Nothing special here, running a Java application:

However, this should not use up all memory and causes the java application to not answer to nagios via JMX.

Why is this using up all my memory and creating SWAP?

Upvotes: 2

Views: 4034

Answers (2)

pd40
pd40

Reputation: 3257

Your -Xmx2500M is the maximum heap size available inside your java application. The overhead of running the JVM and managing the objects in that heap is usually 50% more but can be double the heap size. Linux top command will show this in the virtual memory usage.

A good discussion of non-heap memory usage can be found in the presentation linked here. There is another SO thread on this topic here

One quick check you can do with OpenJDK on ubuntu is to run jps to see which process ID it is, then jconsole, select the memory tab, then select the non-heap memory usage.

If you are attempting to run without swap my guess is you will need to experiment with different heap sizes to see what scenario your application can run. .

Upvotes: 1

jimjim
jimjim

Reputation: 420

try -Xmx2500M not -Xmx=2500M

you don't need the =, -X options are different than -Dkey=value system properties, where = is used

http://javahowto.blogspot.co.uk/2006/06/6-common-errors-in-setting-java-heap.html

Upvotes: 1

Related Questions