Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving notebook fails because of memory error #8914

Closed
asteppke opened this issue Oct 16, 2015 · 3 comments
Closed

Saving notebook fails because of memory error #8914

asteppke opened this issue Oct 16, 2015 · 3 comments
Milestone

Comments

@asteppke
Copy link
Contributor

While working on a medium sized notebook (6 MB on disk) I got an orange error message bar that autosave failed because of a memory error. The notebook contains a number of matplotlib figures.

In the console of the ipython notebook server the following error message is displayed, here the memory error is attributed to a function in handlers.py:

[E 11:17:51.174 NotebookApp] Unhandled error in API request
    Traceback (most recent call last):
      File "c:\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 436,
 in wrapper
        result = yield gen.maybe_future(method(self, *args, **kwargs))
      File "c:\Anaconda3\lib\site-packages\tornado\gen.py", line 870, in run
        value = future.result()
      File "c:\Anaconda3\lib\site-packages\tornado\concurrent.py", line 215, in
result
        raise_exc_info(self._exc_info)
      File "<string>", line 3, in raise_exc_info
      File "c:\Anaconda3\lib\site-packages\tornado\gen.py", line 230, in wrapper

        yielded = next(result)
      File "c:\Anaconda3\lib\site-packages\notebook\services\contents\handlers.p
y", line 236, in put
        model = self.get_json_body()
      File "c:\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 272,
 in get_json_body
        body = self.request.body.strip().decode(u'utf-8')
    MemoryError
[E 11:17:51.178 NotebookApp] {
      "Accept": "application/json, text/javascript, */*; q=0.01",
      "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHT
ML, like Gecko) Chrome/45.0.2454.101 Safari/537.36",
      "Content-Length": "6264026",
      "Accept-Language": "en-US,en;q=0.8",
      "X-Requested-With": "XMLHttpRequest",
      "Accept-Encoding": "gzip, deflate, sdch",
      "Origin": "http://localhost:8888",
      "Content-Type": "application/json",
      "Host": "localhost:8888",
      "Referer": "http://localhost:8888/notebooks/Lab%20protocol%20October%20201
5%2C%20SrRuO4.ipynb",
      "Connection": "keep-alive"
    }

I could split the notebook to avoid this but this would be annoying. Restarting the kernel and clearing all outputs helped, with no output I was able to save the notebook again. I am making use of the the %matplotlib notebook feature and have some inline figures and I guess this is related.
How can I avoid hitting this issue in the future?

@minrk
Copy link
Member

minrk commented Oct 16, 2015

How much memory is available on your machine when this happens? People consistently save notebooks that are 10-50 MB without memory problems. Perhaps you were running code that ate up all of your memory at the time?

@asteppke
Copy link
Contributor Author

@minrk I checked the memory usage, the calculations alone are not taking up much space but all the plots are. I had this notebook running for some time and recreated the plots multiple times.

After searching around a bit more I guess the error I get might just be a symptom of issue #7270.

@takluyver takluyver added this to the no action milestone Jan 26, 2016
@takluyver
Copy link
Member

If there's no more memory available, there's not much we can do. We should try to solve #7270, but I haven't been able to find the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants