jupyter-resource-usage icon indicating copy to clipboard operation
jupyter-resource-usage copied to clipboard

memory not correct if multi process sharing memory

Open Cas-pian opened this issue 6 years ago • 4 comments

The memory is not correct if multi process sharing memory. I think we should use pss of memory_full_info, thanks!

Cas-pian avatar Apr 11 '19 01:04 Cas-pian

@Cas-pian Could you clarify what is meant by "multi process sharing memory"?

You mean the notebook server is being run by multiple processes, all of which are sharing memory?

PSS is a Linux-only feature so we don't plan to actively support that at present. However, starting with version 0.3.4 and later, I think you could get NBResuse to report what you're asking by setting in your Jupyter Notebook config file

c.ResourceUseDisplay.process_memory_metrics = [
{"name": "memory_info", "attribute": "rss"}, {"name": "memory_full_info", "attribute": "pss"}
]

but we still need to tell Prometheus to automatically produce an endpoint giving that information. Also even then it would be up to you or an extension developer to implement a GUI using that information.

krinsman avatar Apr 18 '20 03:04 krinsman

I also think accounting for shared memory is a good idea. Is there any reason we could not use the more accurate pss or uss on platforms where it is available, and fall back to rss where it is not?

jkleint avatar Apr 19 '20 20:04 jkleint

The memory is not correct if multi process sharing memory. I think we should use pss of memory_full_info, thanks!

Same problem

dl-sdu avatar Sep 26 '21 03:09 dl-sdu

This is happening to me when I run a multiprocessing job, multiprocessing.Pool() to be more precise. I assume it's gonna show the same for threads as well. Wouldnt using psutil.virtual_memory() solve this? from the extension info: image from htop image

EnyMan avatar Mar 30 '22 10:03 EnyMan