1

This is my setenv.bat (windows installation). It's the MySQL enterprise monitor service manager.

set JAVA_HOME=D:\MYSQL_~2\SERVIC~1\java
set JAVA_OPTS= ++JvmOptions="-XX:+UseParallelOldGC"  ++JvmOptions="-XX:+UseBiasedLocking" ++JvmOptions="-XX:+HeapDumpOnOutOfMemoryError" ++JvmOptions="-XX:HeapDumpPath=D:\MYSQL_~2\SERVIC~1\apache-tomcat\temp" ++JvmOptions="-Xms128m" ++JvmOptions="-Xmx256m" ++JvmOptions="-XX:MaxPermSize=256m" 

I want to keep the memory occupation below 200M (I mean by looking at tomcat6.exe in task manager).

It goes always above 400M! What's wrong?

EDIT: My setenv.bat is under tomcat\bin

0

-Xms and -Xmx define the minimum and maximum heap sizes, respectively. So the heap alone will be able to exceed 256M in your configuration. However, you have also set -XX:MaxPermSize=256m which defines how much space the permanent generation may take. Heap and permanent generation are separate, so your JVM may take up to 256M (heap via Xmx) + 256M (MaxPermSize) = 512M of memory given the configuration you use.

You could try lowering both Xmx and MaxPermSize to achieve your aim of max. 200M total usage by setting them so that the sum does not exceed your maximum. However, it depends on the deployed application(s) whether this works or if Tomcat will crash with an OutOfMemoryError (worth a try, though).

Oracle has a good guide explaining how the different generations sum up in their Garbage Collector Tuning reference. (I am assuming that you are using the Oracle (formerly Sun) JVM, since you did not specify any version and it should still be the most popular one.)

1
  • ah, teach me to try and answer that from memory ;-)
    – Tom
    May 28 '12 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.