How is JVM memory usage calculated

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm tuning my elastic search cluster and see that the memory usage doesn't line up.



Running "free" on my instance:



free
total used free shared buff/cache available
Mem: 30881324 17072320 238216 49736 13570788 13313528
Swap: 0 0 0


We see that there is 30GB on the machine.



ES was tuned to use 50% of available memory (or max 30GB for oop reasons)
And I can verify here the -Xms and -Xmx flags are set to 15078m:



/bin/java -Xms15078m -Xmx15078m -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch -Des.distribution.flavor=default -Des.distribution.type=rpm -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet



But when running "top" we see a different story.



%MEM is at 59% , many times will show 85% or more (triggering nagios alerts):



 PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
24366 elastic+ 20 0 54.9g 17.5g 1.6g S 267.7 59.3 1849:57 java









share|improve this question

























    up vote
    0
    down vote

    favorite












    I'm tuning my elastic search cluster and see that the memory usage doesn't line up.



    Running "free" on my instance:



    free
    total used free shared buff/cache available
    Mem: 30881324 17072320 238216 49736 13570788 13313528
    Swap: 0 0 0


    We see that there is 30GB on the machine.



    ES was tuned to use 50% of available memory (or max 30GB for oop reasons)
    And I can verify here the -Xms and -Xmx flags are set to 15078m:



    /bin/java -Xms15078m -Xmx15078m -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch -Des.distribution.flavor=default -Des.distribution.type=rpm -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet



    But when running "top" we see a different story.



    %MEM is at 59% , many times will show 85% or more (triggering nagios alerts):



     PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    24366 elastic+ 20 0 54.9g 17.5g 1.6g S 267.7 59.3 1849:57 java









    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm tuning my elastic search cluster and see that the memory usage doesn't line up.



      Running "free" on my instance:



      free
      total used free shared buff/cache available
      Mem: 30881324 17072320 238216 49736 13570788 13313528
      Swap: 0 0 0


      We see that there is 30GB on the machine.



      ES was tuned to use 50% of available memory (or max 30GB for oop reasons)
      And I can verify here the -Xms and -Xmx flags are set to 15078m:



      /bin/java -Xms15078m -Xmx15078m -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch -Des.distribution.flavor=default -Des.distribution.type=rpm -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet



      But when running "top" we see a different story.



      %MEM is at 59% , many times will show 85% or more (triggering nagios alerts):



       PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
      24366 elastic+ 20 0 54.9g 17.5g 1.6g S 267.7 59.3 1849:57 java









      share|improve this question













      I'm tuning my elastic search cluster and see that the memory usage doesn't line up.



      Running "free" on my instance:



      free
      total used free shared buff/cache available
      Mem: 30881324 17072320 238216 49736 13570788 13313528
      Swap: 0 0 0


      We see that there is 30GB on the machine.



      ES was tuned to use 50% of available memory (or max 30GB for oop reasons)
      And I can verify here the -Xms and -Xmx flags are set to 15078m:



      /bin/java -Xms15078m -Xmx15078m -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -XX:+HeapDumpOnOutOfMemoryError -Des.path.home=/usr/share/elasticsearch -Des.path.conf=/etc/elasticsearch -Des.distribution.flavor=default -Des.distribution.type=rpm -cp /usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet



      But when running "top" we see a different story.



      %MEM is at 59% , many times will show 85% or more (triggering nagios alerts):



       PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
      24366 elastic+ 20 0 54.9g 17.5g 1.6g S 267.7 59.3 1849:57 java






      memory java elasticsearch






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 7 at 7:44









      Avner Barr

      1011




      1011

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f460987%2fhow-is-jvm-memory-usage-calculated%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f460987%2fhow-is-jvm-memory-usage-calculated%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?