How to capture heap dump without data in java












-1















I've set -Xmx100g for my java program (i have to), now that i suspect of a memory leak in the program, capturing and loading 100GB heap dump takes more than two hours in each iteration (when i change something in code and want to check if it fixed the memory leak by heap dump analysis). Most of the heap is data (for example half of it is Text file content) and i really do not care about object contents while analyzing the heap.



So how can i skip dumping heap data and have the smallest possible heap dump for memory leak analysis (just Object's metadata and not their values)?










share|improve this question



























    -1















    I've set -Xmx100g for my java program (i have to), now that i suspect of a memory leak in the program, capturing and loading 100GB heap dump takes more than two hours in each iteration (when i change something in code and want to check if it fixed the memory leak by heap dump analysis). Most of the heap is data (for example half of it is Text file content) and i really do not care about object contents while analyzing the heap.



    So how can i skip dumping heap data and have the smallest possible heap dump for memory leak analysis (just Object's metadata and not their values)?










    share|improve this question

























      -1












      -1








      -1








      I've set -Xmx100g for my java program (i have to), now that i suspect of a memory leak in the program, capturing and loading 100GB heap dump takes more than two hours in each iteration (when i change something in code and want to check if it fixed the memory leak by heap dump analysis). Most of the heap is data (for example half of it is Text file content) and i really do not care about object contents while analyzing the heap.



      So how can i skip dumping heap data and have the smallest possible heap dump for memory leak analysis (just Object's metadata and not their values)?










      share|improve this question














      I've set -Xmx100g for my java program (i have to), now that i suspect of a memory leak in the program, capturing and loading 100GB heap dump takes more than two hours in each iteration (when i change something in code and want to check if it fixed the memory leak by heap dump analysis). Most of the heap is data (for example half of it is Text file content) and i really do not care about object contents while analyzing the heap.



      So how can i skip dumping heap data and have the smallest possible heap dump for memory leak analysis (just Object's metadata and not their values)?







      java heap-memory heap-dump






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 19 at 6:08









      f.aldf.ald

      428




      428
























          1 Answer
          1






          active

          oldest

          votes


















          1














          If the heap takes too long to dump, reduce the heap size using -Xmx....



          If you have a memory leak, it is doubtful that you will need a 100GB heap to find the evidence. So reduce it.




          So how can i skip dumping heap data and have the smallest possible heap dump for memory leak analysis (just Object's metadata and not their values)?




          I don't think it is possible. Besides, in a lot of cases, it is the values (e.g. reference chains) that allow you / the profiler to identify the origin of leaking objects.






          share|improve this answer
























          • 60GB of heap would be allocated on application startup, so i can not reduce Xmx

            – f.ald
            Jan 19 at 11:07






          • 1





            Well in that case, you will just have to patient ... and wait while the heap is dumped.

            – Stephen C
            Jan 19 at 11:09











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54264531%2fhow-to-capture-heap-dump-without-data-in-java%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          If the heap takes too long to dump, reduce the heap size using -Xmx....



          If you have a memory leak, it is doubtful that you will need a 100GB heap to find the evidence. So reduce it.




          So how can i skip dumping heap data and have the smallest possible heap dump for memory leak analysis (just Object's metadata and not their values)?




          I don't think it is possible. Besides, in a lot of cases, it is the values (e.g. reference chains) that allow you / the profiler to identify the origin of leaking objects.






          share|improve this answer
























          • 60GB of heap would be allocated on application startup, so i can not reduce Xmx

            – f.ald
            Jan 19 at 11:07






          • 1





            Well in that case, you will just have to patient ... and wait while the heap is dumped.

            – Stephen C
            Jan 19 at 11:09
















          1














          If the heap takes too long to dump, reduce the heap size using -Xmx....



          If you have a memory leak, it is doubtful that you will need a 100GB heap to find the evidence. So reduce it.




          So how can i skip dumping heap data and have the smallest possible heap dump for memory leak analysis (just Object's metadata and not their values)?




          I don't think it is possible. Besides, in a lot of cases, it is the values (e.g. reference chains) that allow you / the profiler to identify the origin of leaking objects.






          share|improve this answer
























          • 60GB of heap would be allocated on application startup, so i can not reduce Xmx

            – f.ald
            Jan 19 at 11:07






          • 1





            Well in that case, you will just have to patient ... and wait while the heap is dumped.

            – Stephen C
            Jan 19 at 11:09














          1












          1








          1







          If the heap takes too long to dump, reduce the heap size using -Xmx....



          If you have a memory leak, it is doubtful that you will need a 100GB heap to find the evidence. So reduce it.




          So how can i skip dumping heap data and have the smallest possible heap dump for memory leak analysis (just Object's metadata and not their values)?




          I don't think it is possible. Besides, in a lot of cases, it is the values (e.g. reference chains) that allow you / the profiler to identify the origin of leaking objects.






          share|improve this answer













          If the heap takes too long to dump, reduce the heap size using -Xmx....



          If you have a memory leak, it is doubtful that you will need a 100GB heap to find the evidence. So reduce it.




          So how can i skip dumping heap data and have the smallest possible heap dump for memory leak analysis (just Object's metadata and not their values)?




          I don't think it is possible. Besides, in a lot of cases, it is the values (e.g. reference chains) that allow you / the profiler to identify the origin of leaking objects.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 19 at 11:03









          Stephen CStephen C

          517k70568925




          517k70568925













          • 60GB of heap would be allocated on application startup, so i can not reduce Xmx

            – f.ald
            Jan 19 at 11:07






          • 1





            Well in that case, you will just have to patient ... and wait while the heap is dumped.

            – Stephen C
            Jan 19 at 11:09



















          • 60GB of heap would be allocated on application startup, so i can not reduce Xmx

            – f.ald
            Jan 19 at 11:07






          • 1





            Well in that case, you will just have to patient ... and wait while the heap is dumped.

            – Stephen C
            Jan 19 at 11:09

















          60GB of heap would be allocated on application startup, so i can not reduce Xmx

          – f.ald
          Jan 19 at 11:07





          60GB of heap would be allocated on application startup, so i can not reduce Xmx

          – f.ald
          Jan 19 at 11:07




          1




          1





          Well in that case, you will just have to patient ... and wait while the heap is dumped.

          – Stephen C
          Jan 19 at 11:09





          Well in that case, you will just have to patient ... and wait while the heap is dumped.

          – Stephen C
          Jan 19 at 11:09


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54264531%2fhow-to-capture-heap-dump-without-data-in-java%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Callistus III

          Plistias Cous

          Index Sanctorum