You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Thanks for the great tool. I have an older version of psutil (2.1.0), which means I can't use memory_full_info(). And I can't upgrade to the latest version in my current situation. I was curious about the other function, memory_maps(). In order to get pss of a processs, can I add up the pss field of all the tuples in the list returned by memory_maps()? And will that be equal to memory_full_info().pss? I am sorry, I don't mean to open an issue here. But I am looking for an answer to if this is a reliable method. Thank you for your time.
The text was updated successfully, but these errors were encountered:
import psutil
p = psutil.Process()
print p.memory_full_info().pss
print sum([x.pss for x in p.memory_maps()])
That should be logically equal.
On my machine that differs by 64K but I suppose it's because memory_maps() build and return an additional dict (which stays in memory).
Full implementation is here:
@giampaolo Thanks for your response. I was also trying to derive uss. On similar lines, is the below code snippet also true?
import psutil
proc = psutil.Process()
proc.memory_full_info().uss == sum(pmmap.private_clean for pmmap in proc.memory_maps()) + sum(pmmap.private_dirty for pmmap in proc.memory_maps())
Hi,
Thanks for the great tool. I have an older version of psutil (2.1.0), which means I can't use memory_full_info(). And I can't upgrade to the latest version in my current situation. I was curious about the other function, memory_maps(). In order to get pss of a processs, can I add up the pss field of all the tuples in the list returned by memory_maps()? And will that be equal to memory_full_info().pss? I am sorry, I don't mean to open an issue here. But I am looking for an answer to if this is a reliable method. Thank you for your time.
The text was updated successfully, but these errors were encountered: