Reputation: 1256
I am using jupyter notebook with Python3 on windows 10. My computer has 8GB RAM and at least 4GB of my RAM is free.
But when I want to make a numpy ndArray with size 6000*6000 with this command:
np.zeros((6000, 6000), dtype='float64')
I got this : Unable to allocate array with shape (6000, 6000) and data type float64
I don't think this could use more then 100MB RAM. I tried to change the number to see what happens. The biggest array I can make is (5000,5000). Did I make a mistake in estimating how much RAM I need?
Upvotes: 56
Views: 165264
Reputation: 910
Jupyter notebook has a default memory limit size. You can try to increase the memory limit by following the steps:
Generate a config file using:
jupyter notebook --generate-config
Open the jupyter_notebook_config.py
file situated inside the jupyter
folder and edit the following property:
NotebookApp.max_buffer_size = your desired value
Remember to remove the #
before the property value.
Save and run the Jupyter notebook. It should now be able utilize the set memory value. Also, don’t forget to run the notebook from inside the Jupyter folder.
Alternatively, you can simply run the notebook using below command:
jupyter notebook --NotebookApp.max_buffer_size=your_value
Upvotes: 63
Reputation: 10048
For Jupyter you need to consider 2 processes:
max_buffer_size is a Tornado Web Server setting, corresponds to the Maximum amount of incoming data to buffer and defaults to 100MB (104857600). (https://www.tornadoweb.org/en/stable/httpserver.html)
Based on this PR, this value seems to have been increased to 500 MB in Notebook.
Tornado HTTP server does not allow to my knowledge to define the max memory, it runs as a Python3 process.
For the kernel, you should look at the command defined kernel spec.
An option to try would be this one
Upvotes: 8