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

RSS size should be used for sorting processes instead of VIRT, when doing poll_mem #21

Open
sankouski-dzmitry opened this issue Sep 9, 2021 · 1 comment

Comments

@sankouski-dzmitry
Copy link

sankouski-dzmitry commented Sep 9, 2021

In my vision, poll_mem is mostly used to determine, where your physical RAM leaks. VIRT memory doesn't show physical RAM occupation. To get process physical memory occupation, we should use RES memory.

To clearly illustrate, here is part of the log, showing chrome memory consumption:

PID         DATE      TIME      ELAPSED    CPU    MEM       RSS     VSIZE       CMD
12049   2021-09-08  17:16:57        00:01   24.0    0.4    135376  38186116  /opt/google/chrome/chrome --type=renderer --enable-automation --enable-logging --log-level=0 --remote-debugging-port=0 --test-type=webdriver --allow-pre-commit-input --field-trial-handle=9868597751347894126,1640417613699088952,131072 --disable-gpu-compositing --enable-blink-features=ShadowDOMV0 --lang=en-US --user-data-dir=/tmp/.com.google.Chrome.aFUGnx --disable-client-side-phishing-detection --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=7 --no-v8-untrusted-code-mitigations --shared-files=v8_context_snapshot_data:100

This chrome process was spawned by selenoid, when running UI autotests. As you can see, it mapped ~38GB of virtual memory (which is more that I have RAM on a server). On the other hand, it occupies only ~136MB of RAM. There's also other similar cases.

I think, a solution may be to give a choice for user, which memory to use for process sorting. Also default would be logical to change to RSS, IMHO.

@mimmus
Copy link

mimmus commented Aug 5, 2024

Change line 302:
pinfoset = sorted(pinfoset, key=lambda v: int(v['rss']), reverse=True)[:top_mem]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants