Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: memory stats broken #8430

Closed
cookieo9 opened this issue Jul 27, 2014 · 4 comments
Closed

runtime: memory stats broken #8430

cookieo9 opened this issue Jul 27, 2014 · 4 comments
Milestone

Comments

@cookieo9
Copy link
Contributor

The value of HeapInuse, as displayed by runtime.ReadMemStats, and in the scavenger lines
when gc trace mode is enabled both show excessively large values. HeapIdle values look
also to be inflated, although not to such an extreme degree.

For example, on my machine: go version devel +fda4c0d14c53 Sat Jul 26 17:46:51 2014
-0400 darwin/amd64

Using the net/http/pprof interface when running godoc (after a few minutes of running)
provides:
# runtime.MemStats
# Alloc = 1811664
# TotalAlloc = 134017400
# Sys = 25450744
# Lookups = 11707
# Mallocs = 521186
# Frees = 502891
# HeapAlloc = 1811664
# HeapSys = 15138816
# HeapIdle = 918953984
# HeapInuse = 18446744072783716352
# HeapReleased = 10821632
# HeapObjects = 18295

When the scavenger runs (in gctrace=1 mode) it similarly reports:
scvg6: inuse: 17592186043539, idle: 876, sys: 21, released: 10, consumed: 10 (MB)

At first glance it looks like HeapInuse could be a negative number stored in a uint64,
suggesting that HeapIdle might be the only thing that is broken.
@ianlancetaylor
Copy link
Member

Comment 1:

Labels changed: added repo-main, release-go1.4.

@dvyukov
Copy link
Member

dvyukov commented Aug 18, 2014

Comment 2:

Owner changed to @dvyukov.

Status changed to Started.

@gopherbot
Copy link
Contributor

Comment 3:

CL https://golang.org/cl/130200044 mentions this issue.

@dvyukov
Copy link
Member

dvyukov commented Aug 19, 2014

Comment 4:

This issue was closed by revision 30ef2c7.

Status changed to Fixed.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
Newly allocated memory is subtracted from inuse, while it was never added to inuse.
Span leftovers are subtracted from both inuse and idle,
while they were never added.
Fixes golang#8544.
Fixes golang#8430.

LGTM=khr, cookieo9
R=golang-codereviews, khr, cookieo9
CC=golang-codereviews, rlh, rsc
https://golang.org/cl/130200044
wheatman pushed a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
Newly allocated memory is subtracted from inuse, while it was never added to inuse.
Span leftovers are subtracted from both inuse and idle,
while they were never added.
Fixes golang#8544.
Fixes golang#8430.

LGTM=khr, cookieo9
R=golang-codereviews, khr, cookieo9
CC=golang-codereviews, rlh, rsc
https://golang.org/cl/130200044
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants