go tool pprof -inuse_space much smaller than linux top shows
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
My program runs in background. I use linux top command, it shows 16g
memory. But when I want to use go pprof -inuse_space
to check the point, I gives only 200M
. Where do the other memory go?
go heap profile pprof
add a comment |
My program runs in background. I use linux top command, it shows 16g
memory. But when I want to use go pprof -inuse_space
to check the point, I gives only 200M
. Where do the other memory go?
go heap profile pprof
3
"Memory usage" is a really complicated issue on modern systems. In short: all is fine, there is nothing to worry here. These are two different numbers and they are not related but all is fine.
– Volker
Jan 4 at 9:56
Which column in top? As Volker noted memory usage is complicated, as evidenced by the three columns of memory usage per process that top shows you. I'm guessing you looked atVIRT
(which is huge for pretty much every process ever) and panicked. Look atRES
, which is a more accurate depiction of process memory usage.
– Adrian
Jan 4 at 16:26
New data is VIRT 42g RES 0.024t。When I use go tool pprof -inuse_space localhost:2000/debug/pprof/heap,it shows it only use 156.75MB memory. I just don't know where the memory sits.
– darjun
Jan 7 at 1:40
add a comment |
My program runs in background. I use linux top command, it shows 16g
memory. But when I want to use go pprof -inuse_space
to check the point, I gives only 200M
. Where do the other memory go?
go heap profile pprof
My program runs in background. I use linux top command, it shows 16g
memory. But when I want to use go pprof -inuse_space
to check the point, I gives only 200M
. Where do the other memory go?
go heap profile pprof
go heap profile pprof
edited Jan 4 at 12:39
NullPointerException
2,38811834
2,38811834
asked Jan 4 at 8:51
darjundarjun
41
41
3
"Memory usage" is a really complicated issue on modern systems. In short: all is fine, there is nothing to worry here. These are two different numbers and they are not related but all is fine.
– Volker
Jan 4 at 9:56
Which column in top? As Volker noted memory usage is complicated, as evidenced by the three columns of memory usage per process that top shows you. I'm guessing you looked atVIRT
(which is huge for pretty much every process ever) and panicked. Look atRES
, which is a more accurate depiction of process memory usage.
– Adrian
Jan 4 at 16:26
New data is VIRT 42g RES 0.024t。When I use go tool pprof -inuse_space localhost:2000/debug/pprof/heap,it shows it only use 156.75MB memory. I just don't know where the memory sits.
– darjun
Jan 7 at 1:40
add a comment |
3
"Memory usage" is a really complicated issue on modern systems. In short: all is fine, there is nothing to worry here. These are two different numbers and they are not related but all is fine.
– Volker
Jan 4 at 9:56
Which column in top? As Volker noted memory usage is complicated, as evidenced by the three columns of memory usage per process that top shows you. I'm guessing you looked atVIRT
(which is huge for pretty much every process ever) and panicked. Look atRES
, which is a more accurate depiction of process memory usage.
– Adrian
Jan 4 at 16:26
New data is VIRT 42g RES 0.024t。When I use go tool pprof -inuse_space localhost:2000/debug/pprof/heap,it shows it only use 156.75MB memory. I just don't know where the memory sits.
– darjun
Jan 7 at 1:40
3
3
"Memory usage" is a really complicated issue on modern systems. In short: all is fine, there is nothing to worry here. These are two different numbers and they are not related but all is fine.
– Volker
Jan 4 at 9:56
"Memory usage" is a really complicated issue on modern systems. In short: all is fine, there is nothing to worry here. These are two different numbers and they are not related but all is fine.
– Volker
Jan 4 at 9:56
Which column in top? As Volker noted memory usage is complicated, as evidenced by the three columns of memory usage per process that top shows you. I'm guessing you looked at
VIRT
(which is huge for pretty much every process ever) and panicked. Look at RES
, which is a more accurate depiction of process memory usage.– Adrian
Jan 4 at 16:26
Which column in top? As Volker noted memory usage is complicated, as evidenced by the three columns of memory usage per process that top shows you. I'm guessing you looked at
VIRT
(which is huge for pretty much every process ever) and panicked. Look at RES
, which is a more accurate depiction of process memory usage.– Adrian
Jan 4 at 16:26
New data is VIRT 42g RES 0.024t。When I use go tool pprof -inuse_space localhost:2000/debug/pprof/heap,it shows it only use 156.75MB memory. I just don't know where the memory sits.
– darjun
Jan 7 at 1:40
New data is VIRT 42g RES 0.024t。When I use go tool pprof -inuse_space localhost:2000/debug/pprof/heap,it shows it only use 156.75MB memory. I just don't know where the memory sits.
– darjun
Jan 7 at 1:40
add a comment |
1 Answer
1
active
oldest
votes
Generally, the memory used in os(shown by top VIRT) is larger than pprof. One reason is gc will happen when heap size > ($GOGC% + 1) * (reachable nodes size): https://blog.golang.org/go15gc. By default, $GOGC is 100, that means the memory size will be twice of the heap size shown by pprof. But you seem not to be in this case.
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%2f54035670%2fgo-tool-pprof-inuse-space-much-smaller-than-linux-top-shows%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
Generally, the memory used in os(shown by top VIRT) is larger than pprof. One reason is gc will happen when heap size > ($GOGC% + 1) * (reachable nodes size): https://blog.golang.org/go15gc. By default, $GOGC is 100, that means the memory size will be twice of the heap size shown by pprof. But you seem not to be in this case.
add a comment |
Generally, the memory used in os(shown by top VIRT) is larger than pprof. One reason is gc will happen when heap size > ($GOGC% + 1) * (reachable nodes size): https://blog.golang.org/go15gc. By default, $GOGC is 100, that means the memory size will be twice of the heap size shown by pprof. But you seem not to be in this case.
add a comment |
Generally, the memory used in os(shown by top VIRT) is larger than pprof. One reason is gc will happen when heap size > ($GOGC% + 1) * (reachable nodes size): https://blog.golang.org/go15gc. By default, $GOGC is 100, that means the memory size will be twice of the heap size shown by pprof. But you seem not to be in this case.
Generally, the memory used in os(shown by top VIRT) is larger than pprof. One reason is gc will happen when heap size > ($GOGC% + 1) * (reachable nodes size): https://blog.golang.org/go15gc. By default, $GOGC is 100, that means the memory size will be twice of the heap size shown by pprof. But you seem not to be in this case.
answered Jan 14 at 8:48
zhshuai1zhshuai1
1
1
add a comment |
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%2f54035670%2fgo-tool-pprof-inuse-space-much-smaller-than-linux-top-shows%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
3
"Memory usage" is a really complicated issue on modern systems. In short: all is fine, there is nothing to worry here. These are two different numbers and they are not related but all is fine.
– Volker
Jan 4 at 9:56
Which column in top? As Volker noted memory usage is complicated, as evidenced by the three columns of memory usage per process that top shows you. I'm guessing you looked at
VIRT
(which is huge for pretty much every process ever) and panicked. Look atRES
, which is a more accurate depiction of process memory usage.– Adrian
Jan 4 at 16:26
New data is VIRT 42g RES 0.024t。When I use go tool pprof -inuse_space localhost:2000/debug/pprof/heap,it shows it only use 156.75MB memory. I just don't know where the memory sits.
– darjun
Jan 7 at 1:40