5 Replies Latest reply: May 7, 2010 5:27 AM by 843829 RSS

    -XX:MaxHeapFreeRatio doesnt seem to work with the "-server -XX:ParallelGC"

      We are running a java server app with the following parameters
      java -server   -XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC  
             -XX:NewSize=3G -XX:MaxNewSize=3G -Xloggc:/home/user/gc.log 
             -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps  -Xmx24G  ...
      The java server process memory usage shoots upto 19GB while the used memory according to the gc logs is less than 5G. I know that by default the 'MaxHeapFreeRatio' jvm parameter is set to 70% which means that the total free space in the jvm should not exceed 70% of the total allocated space. Hence with the total process space taking 19GB, the total free space should not exceed 13.3GB (70% of 19GB). In this case the total free space is 19GB - 5GB = 14GB.

      The problem statement in detail : We have a java server that requires ~5GB of space when low on load and ~12-15GB of heap space when high on load. To be on a safer side, we have configured it to run with 24GB. When the jvm starts expanding (due to increased load) it reaches 15GB. But when the load is low, the jvm process memory usage gets pinned to 15GB. At times it shoots to 19GB and stays there forever.

      The problem with this is 2 fold :
      1) When the jvm does a GC (i.e when it reaches 19GB), it takes some time for the GC to happen. Hence if the process memory usage is low (i.e if we can get it to shrink from 15GB to 8.33GB) then the time taken in GC would decrease.

      2) We do frequent forks in the server jvm (for 'du -sh' and 'df -kh' like commands). Hence fork becomes costly if the parent process has huge memory.

      If we can cut down the server memory, we can get some performance benefits.