Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to limit size of committed virtual memory in JDK 8?

KarelGardasSep 18 2014 — edited Sep 23 2014

Hello,

I'm using JDK 8 on Solaris 11.1 on x64 box:

$ java -version
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)

I'm running tomcat/xwiki on top of this. I've set following runtime options to limit memory usage of Java:

CATALINA_OPTS="-d64 -server -Xms1024m -Xmx1024m -XX:MaxMetaspaceSize=1024m -XX:MaxPermSize=196m -Dfile.encoding=utf-8 -Djava.awt.headless=true -XX:+UseParallelGC -XX:MaxGCPauseMillis=100"

those params are taken from the same project from time JDK 7 was used so I've left -XX:MaxPermSize there even if it's no longer supported and I just added -XX:MaxMetaspaceSize=1024m for JDK 8.

My problem with this is that when I put server under load by pushing new pages over its REST API to the XWiki, then I see that RSS (in prstat) is oscillating around 1.5GB, but SIZE is steadily growing and whole process of pushing pages to the server gets slower and slower.

The problem is that I'm not able to detect any obvious memory leak by using jconsole nor by using visual vm and heap dump. They both claims that in sum my JDK consumes up to 2GB RAM. The only exception is jconsole which in its VM Summary pane tells me that the amount of "Committed virtual memory:" is around 14GB which corresponds to observation from SIZE value from prstat utility.

Since I don't like the idea of JVM consuming more and more memory with possibility to not stop in this process I'd like to ask if there is any parameter which will allow me to set hard memory limit allowed to be used by whole JVM?

Any idea is highly appreciated here,

Thanks!

Karel

This post has been answered by KarelGardas on Sep 23 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 21 2014
Added on Sep 18 2014
1 comment
2,531 views