Memory usage is misleading #47
Comments
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
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
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 ? |
@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 :) |
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
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.
The text was updated successfully, but these errors were encountered: