pythonprofilers / memory_profiler

Monitor Memory usage of Python code
http://pypi.python.org/pypi/memory_profiler
Other
4.32k stars 375 forks source link

Use virtual instead of resident memory size #146

Open Celelibi opened 7 years ago

Celelibi commented 7 years ago

It looks like memory_profiler prefer to use the "RSS" field over the "VMS" field. I'm not sure I understand this choice as it exclude everything that's swapped to disk.

That reduces the usefulness of this tool to optimize the memory usage since:

So, maybe an option could be given to indicate whether we want the resident memory size or the virtual memory size. What do you think?

fabianp commented 7 years ago

@Celelibi , which backend are you refering to? memory_profiler uses different backends to get the memory consumption, such as psutils or using ps on UNIX when psutils is not available ...

In any case, you have a point: by default the full memory consumption (including swap space) should be reported. I would gladly accept patches correcting this behavior ...

dendibakh commented 6 months ago

I suggest plotting both VMS and RSS at the same time.