0

Background:

Windows Server 2012 R2- 64 bit
16 GB RAM
Tomcat 8
Java 8 

I am running a java application on Tomcat 8. I am facing high memory usage problem. The memory usage goes up to 95% and server crashes. No problem with CPU usage.

I am setting JAVA_OPTS in tomcat\bin\catalina.bat

set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG% -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:PermSize=512m -XX:+UseParallelGC"

NOTE: XMS and XMX is set from catalina UI.

I understand, there is no PermGen concept in Java 8 so I tried below JAVA_OPTS with -XX:MaxMetaspaceSize=512m too

set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG% -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:MaxMetaspaceSize=512m -XX:+UseParallelGC"

But no luck.

Interesting thing:

The memory used by tomcat process remain around 3.5 GB but memory usage goes up to 15 GB. All the remaining processes add up to 1 GB only. I have no clue which process is consuming remaining 9-10 GB.

The system memory goes up and here is the snap. Task Manager

Any thoughts?

Thanks.

AKumar
  • 95
  • 2
  • 14
  • Please correct me if i am wrong:The Permgen space has been removed completely from Java 8 and metaspace has been introduced. Metaspace uses native memory of OS so it is possible that the undiscovered 9-10 GBs are being eaten up by Metaspace. If this theory is correct. Can someone tell me how to restrict Metaspace. I have already tried XX:MaxMetaspaceSize... thanks – AKumar Oct 27 '16 at 08:15
  • you need to post more deteiled stats. what memory usage goes up (system or vm?) which memory figures (rss, buffers, virtual, ...). anything that might be useful. – the8472 Oct 27 '16 at 12:41
  • Added snapshot of system's task manager. – AKumar Oct 28 '16 at 01:30
  • so it's not really the java process itself allocating the memory. you could try sysinternals process explorer and rammap tools. – the8472 Oct 28 '16 at 10:03
  • Are you suggesting, there is nothing wrong with the tomcat or java. Is it something to do with other System process which is eating up the RAM?? – AKumar Oct 28 '16 at 10:40
  • that is a possibility – the8472 Oct 28 '16 at 11:20

1 Answers1

0

The problem was with the VM we were using. There were some update processes which use to keep the VM busy.

AKumar
  • 95
  • 2
  • 14