How can I measure the memory required to run a Jupyter notebook?

Viewed 16

I am preparing a Jupyter notebook which uses large arrays (1-40 GB), and I want to give its memory requirements, or rather:

  • the amount of free memory (M) necessary to run the Jupyter server and then the notebook (locally),
  • the amount of free memory (N) necessary to run the notebook (locally) when the server is already running.

The best idea I have is to:

  • run /usr/bin/time -v jupyter notebook,
  • assume that "Maximum resident set size" is the memory used by the server alone (S),
  • download the notebook as a *.py file,
  • run /usr/bin/time -v ipython notebook.py
  • assume that "Maximum resident set size" is the memory used by the code itself (C).

Then assume N > C and M > S + C.

I think there must be a better way, as:

  • I expect Jupyter notebook to use additional memory to communicate with client etc.,
  • there is also additional memory used by the client run in a browser,
  • Uncollected garbage contributes to C, but should not be counted as the required memory, should it?
0 Answers
Related