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
Current Process().memory_full_info() reads /proc/<pid>/smaps, and then sums across maps. This can be slow if there are many maps.
Linux provides a /proc/<pid>/smaps_rollup that is the information in smaps summarized across the whole process: exactly what this function is calculating. For processes with large number of mmaps, using this file directly would reduce the cost of memory_full_info() significantly.
This was apparently added to Linux sometime in 2017 or 2018.
It's the same format, so you could the exact same code, even, just open that file instead if it exists.
The text was updated successfully, but these errors were encountered:
Summary
Description
Current
Process().memory_full_info()
reads/proc/<pid>/smaps
, and then sums across maps. This can be slow if there are many maps.Linux provides a
/proc/<pid>/smaps_rollup
that is the information insmaps
summarized across the whole process: exactly what this function is calculating. For processes with large number of mmaps, using this file directly would reduce the cost ofmemory_full_info()
significantly.This was apparently added to Linux sometime in 2017 or 2018.
It's the same format, so you could the exact same code, even, just open that file instead if it exists.
The text was updated successfully, but these errors were encountered: