Skip to content
This repository has been archived by the owner on May 10, 2020. It is now read-only.

Memory usage is misleading #47

Closed
frol opened this issue Jul 27, 2017 · 2 comments
Closed

Memory usage is misleading #47

frol opened this issue Jul 27, 2017 · 2 comments

Comments

@frol
Copy link

frol commented Jul 27, 2017

There was a long-standing bug in Docker stats util (moby/moby#10824), which included caches into the memory usage reporting. While it was fixed recently in Docker 17.06 (docker/cli#80), ctop is still affected by the issue.

I think it is worth porting the new way of memory usage reporting from the docker/cli#80.

yadutaf added a commit that referenced this issue Jul 27, 2017
Arguably, cache space is also reclaimable, meaning that, under pressure,
it can be reclaimed instead of triggering an OOM. Wether to substract it
or not would be a debate in itself. I chose to do it here to follow the
lead of Docker. Even if this is not the best decision (and I have not
opinion on that), doing the opposite would introduce confusion and
confusion rarely do good.

See: moby/moby#10824
yadutaf added a commit that referenced this issue Jul 27, 2017
Arguably, cache space is also reclaimable, meaning that, under pressure,
it can be reclaimed instead of triggering an OOM. Wether to substract it
or not would be a debate in itself. I chose to do it here to follow the
lead of Docker. Even if this is not the best decision (and I have not
opinion on that), doing the opposite would introduce confusion and
confusion rarely do good.

See: moby/moby#10824
@yadutaf
Copy link
Owner

yadutaf commented Jul 27, 2017

Thanks for the suggestion. Not sure you can call it a "bug". The information returned is totally valid. It is arguably more accurate in the sense that it represents the memory cells that are actually in use. That said, this tool aims to be useful to people running actual systems. And they will most probably be interested in "how far are we from running OOM" , which is better answered with the cache subtracted.

Additionally, this is what Docker does. Docker being a de-facto standard, I changed it to be consistent.

Can you test with the commit above and confirm this matches your need ?

@frol
Copy link
Author

frol commented Jul 28, 2017

@yadutaf The fix seems to work as expected!

P.S. It is hilarious that I used another bcicen/ctop, but the reported issue turned out to be a valid issue for this ctop as well :)

yadutaf added a commit that referenced this issue Jul 28, 2017
Arguably, cache space is also reclaimable, meaning that, under pressure,
it can be reclaimed instead of triggering an OOM. Wether to substract it
or not would be a debate in itself. I chose to do it here to follow the
lead of Docker. Even if this is not the best decision (and I have not
opinion on that), doing the opposite would introduce confusion and
confusion rarely do good.

See: moby/moby#10824
@yadutaf yadutaf closed this as completed Jul 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants