How to capture heap dump without data in java
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
add a comment |
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
add a comment |
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
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
java heap-memory heap-dump
asked Jan 19 at 6:08
f.aldf.ald
428
428
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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.
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
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
add a comment |
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.
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
add a comment |
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.
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.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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