2 Replies Latest reply on May 23, 2013 1:34 PM by Rodrigo Traba

    Why JVM shows another Heap size when Xms=Xsx?

    Rodrigo Traba
      Hi everybody. I have two instances of oc4j on a cluster of two nodes. The configuration of parameters on opmn.xml is exactly the same for both instances.
      Particulary I see an strange behavior on memory heap. I expect that if Xmx and Xms parameters are equals to 4096, then the heap size must be fixed on 4 Gb exactly, and there will be not resizing.
      But monitoring the heaps with JVisualVM I can see that the heap size of the first instance is moving between 3.7 and 4 Gb, and the Heap size of the second node is moving around 3.2 Gb. The hosts have both 16 Gb of RAM, it's running on Windows 2003 Server R2 and there is no overload on the OS.
      Possibly the behavior is normal and I just have a wrong understanding of what is expectable.
      Here are some parameteres extracted from opmn.xml file:

      -D64
      -Dcom.sun.management.jmxremote
      -Xmx4096M
      -Xms4096M
      -XX:+UseParallelGC
      -verbose:gc
      -XX:+PrintGCTimeStamps
      -XX:+PrintGCDetails
      -Xloggc:D:\oracle\product\10.1.3\soa\j2ee\OC4J_SOA\archivo_loggc.log
      -Dcom.sun.management.jmxremote.port=8004
      -Dcom.sun.management.jmxremote.authenticate=false
      -Dcom.sun.management.jmxremote.ssl=false
      -Djava.security.policy=D:\oracle\product\10.1.3\soa\j2ee\OC4J_SOA\config\java2.policy
      -Djava.awt.headless=true
      -Dhttp.webdir.enable=false
      -Doc4j.userThreads=true
      -Doracle.mdb.fastUndeploy=60
      -Doc4j.formauth.redirect=true
      -Djava.net.preferIPv4Stack=true
      -Dorabpel.home=D:\oracle\product\10.1.3\soa\bpel
      -Xbootclasspath/p:D:\oracle\product\10.1.3\soa\bpel\lib\orabpel-boot.jar
      -Dstdstream.filesize=8
      -Dstdstream.filenumber=30
      -Dhttp.proxySet=false
      -XX:MaxPermSize=768M
      -XX:PermSize=768M
      -Doraesb.home=D:\oracle\product\10.1.3\soa\integration\esb
      -Dorabpel.process.lock.timeout=300
      -Drmi.client.connection.timeout=100
      -Doracle.dms.hunter.sleeptime=600000
      -Doracle.dms.gatherers=300000,2:1800000:3
      -Djavax.net.ssl.keyStore=D:\oracle\product\10.1.3\soa\jdk\jre\lib\security\cacerts
      -Djavax.net.ssl.keyStorePassword=changeit
      -DopmnPingInterval=90
      -Xrs
      -DHTTPClient.socket.staleCheck=true
      -DHTTPClient.disableKeepAlives=true
      -XX:+HeapDumpOnOutOfMemoryError
        • 1. Re: Why JVM shows another Heap size when Xms=Xsx?
          1007359
          Hi Rodrigo,

          Where are you looking in jvisualvm to determine your heap size? In the Monitor tab you should see the heap usage graph on the top right. There you will see the reported heap size and max, as well as the currently used heap. In your case, both heap size and max should be roughly around 4096M, but the used heap will fluctuate along with your application needs.

          BTW, looking at your config you have 768M configured for your PermGen. It's surprisingly large, but depending on what your application does it may be warranted.

          Cheers
          • 2. Re: Why JVM shows another Heap size when Xms=Xsx?
            Rodrigo Traba
            Hi Sebastien, Thanks for responding.
            In fact I'm looking exactly where you say to determine your heap size.
            The thing is that I can't understand why one instance takes some minor heap size and fluctuates the size while the other instance take around 4 Gb and kept static in this value. I can see there is no diferences on configuration for both. I know that the used heap must present diferent behavior, but not the total size. I think that the size should be fixed and static with Xmx=Xms=4096, but this is not happening.
            I would like to show an image to ilustrate what I'm describing.
            About the PermGen, I think there's no problem with that, around 80% is in effective use, and this value is stable.
            Best regards