From: <mar...@pt...> - 2014-06-27 12:30:03
|
Hi, AFAIK -Xmx does not set the overall memory limit but the maximum heap size: >From http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html (Sizing the Generations) At initialization of the virtual machine, the entire space for the heap is reserved. The size of the space reserved can be specified with the -Xmx option. If the value of the -Xms parameter is smaller than the value of the -Xmx parameter, not all of the space that is reserved is immediately committed to the virtual machine. see also - http://stackoverflow.com/questions/6450132/java-seems-to-ignore-xms-and-xmx-options/6450260#6450260 - http://stackoverflow.com/questions/11801254/jvm-options-xms-and-xmx-are-ignored/11801546#11801546 The -Xmx256m was/is specified in the css.ini file: -vmargs -Xmx256m -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog -Dorg.apache.commons.logging.simplelog.defaultlog=fatal -Dno_proxy=127.0.0.1,localhost After starting it when using ps -ef | grep css I see the long outout with ... /usr/bin/java -vmargs -Xmx256m ... VisualVM also shows it in JVM arguments and in the monitor tab (as Gabriele showed in the screenshots): Heap: Max: 268.435.456 B Perm Gen Max: Max: 174.063.616 B For Perm Gen it seems to be really difficult to follow. What is also mentioned is - Code Cache (non-heap): The HotSpot Java VM also includes a code cache, containing memory that is used for compilation and storage of native code - Stack Size per thread: http://stackoverflow.com/questions/3513903/how-to-calculate-and-specify-the-total-memory-space-allowed-for-java-process/3515058#3515058 http://docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html also says that non-heap "requires memory for internal processing or optimization". Marcus Von: "Kasemir, Kay" <kas...@or...> An: "mar...@pt..." <mar...@pt...> Kopie: "Kasemir, Kay" <kas...@or...>, "Carcassi, Gabriele" <car...@bn...>, "cs-...@li..." <cs-...@li...> Datum: 26.06.2014 19:12 Betreff: Re: [Cs-studio-users] Filling Memory when observing PVs Hi: I don't understand. If you set -Xmx256m, that defines the overall memory limit. The JVM could stop because what you want to do is not possible with -Xmx256m. It shouldn't keep growing to the point where the Linux oom-killer becomes active. There may be some difference between what the JVM considers "256m" and what Linux sees for the overall process, but there's a huge difference between -Xmx256m = 256 MB and total-vm:7278584kB = 7GB. Maybe the -Xmx256m wasn't effective? Where did you specify it? As for perm gen space, there is a default limit built into the product. It's not unlimited. Perm gen space is as you say for classes, strings, ..,it doesn't tend to grow with runtime except for that Jython problem where each newly executed Jython file uses new perm gen space memory. Thanks, Kay On Jun 25, 2014, at 1:39 PM, mar...@pt... wrote: Hi, > > I started the process with -Xmx256m but without any definition for perm size. Does this mean I am allowing > (theoretically) infinite perm gen space for the process/vm ? But does this matter since in perm gen there > are classes, Strings and other static stuff and the dynamically allocated space for objects etc. ist stored on > the heap (which has a limit) ? > I will try to repeat the tests with the perm gen size limit and see what happens... > Curious what will happen when using Java 8 where the perm gen limit parameter has been removed: http://openjdk.java.net/jeps/122 . > > P.S. The 45,6% Memory process stopped running because the linux oom-killer process decided to stop it: > > [So Jun 22 21:09:41 2014] Out of memory: Kill process 21744 (java) score 474 or sacrifice child > [So Jun 22 21:09:41 2014] Killed process 21744 (java) total-vm:7278584kB, anon-rss:4446556kB, file-rss:968kB > > Marcus |