I need to create a Python Script that Returns only the Process using the most memory at that time. I am having problems with parsing the values. What I have so far:
import psutil
x = psutil.pids()
for i in x:
p = psutil.Process(i)
print(p.name(), p.memory_full_info())
This returns the full list of processes in this format:
ssh-agent pfullmem(rss=339968, vms=11350016, shared=0, text=352256, lib=0, data=421888, dirty=0, uss=598016, pss=605184, swap=0)
I am getting value errors whenever I try to manipulate these values. I want to just return the MOST memory intensive process and perhaps the RSS or VMS value.