About JVM heap space

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
rockkth
Posts: 196
Joined: Sat Jul 04, 2009 8:54 am

About JVM heap space

Post by rockkth »

If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision Number: 3430
L2JDP Revision Number: 6537

I have read a lot of info about JVM , heap sizes and general config...still, the one thing i don t understand is

why the JV after increases to the max size (xmx) doesen`t decrease , cleaning up garbage using (xmn) but gives errors in game console and eats up the cpu instead of freeing up the java app used memory when it reaches the max value, also many functions in game seize to function

this is my startup.bat

Code: Select all

java -server  -Xmx2048m -Xms2048m -Xmn512m -XX:PermSize=256m -XX:SurvivorRatio=8 -Xnoclassgc -XX:+AggressiveOpts -cp ./../libs/*;l2jserver.jar net.sf.l2j.gameserver.GameServer
the thing i use to do is minimize the console window, so the application reduces the consumed phisical memory to a minimum and increases again in time to a max value, usually takes a long time to reach max value so it s kind of ok, but shouldnt it be doing it automatically?

-Xms<size>
Specifies the initial size of the committed memory within the Java™ heap. It also specifies the minimum size of the committed area. The value must be a multiple of 1024 greater than 1MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes.

For example, -Xms6291456, -Xms6144k, -Xms1500M

-Xmx<size>
Specifies the maximum size of the Java™ heap. The value must a multiple of 1024 greater than 2MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes.

For example, -Xmx83886080, -Xmx81920k, -Xmx1500M

You will notice the increased memory footprint described in the previous section most if you set -Xms to the same value as -Xmx. This is because the whole of the associated heap spaces are committed and the JVM reserves swap for them by touching every page. In this case it would be better to use the -XX:+ForceMmapReserved option because it is more efficient.
Due to the design of HP-UX, the heap is not one contiguous mmap. When the heap is getting this large, either the new space, set with -Xmn, or old space, set by the difference of Xmx and Xmn, must be 900MB or less
( i have it 512).
Post Reply