{"action":"created","issue":{"url":"https://api.github.com/repos/plotly/plotly.js/issues/957","repository_url":"https://api.github.com/repos/plotly/plotly.js","labels_url":"https://api.github.com/repos/plotly/plotly.js/issues/957/labels{/name}","comments_url":"https://api.github.com/repos/plotly/plotly.js/issues/957/comments","events_url":"https://api.github.com/repos/plotly/plotly.js/issues/957/events","html_url":"https://github.com/plotly/plotly.js/issues/957","id":178196556,"number":957,"title":"Memory leak with surface plots in IPython/Jupyter notebooks","user":{"login":"samuela","id":226872,"avatar_url":"https://avatars.githubusercontent.com/u/226872?v=3","gravatar_id":"","url":"https://api.github.com/users/samuela","html_url":"https://github.com/samuela","followers_url":"https://api.github.com/users/samuela/followers","following_url":"https://api.github.com/users/samuela/following{/other_user}","gists_url":"https://api.github.com/users/samuela/gists{/gist_id}","starred_url":"https://api.github.com/users/samuela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuela/subscriptions","organizations_url":"https://api.github.com/users/samuela/orgs","repos_url":"https://api.github.com/users/samuela/repos","events_url":"https://api.github.com/users/samuela/events{/privacy}","received_events_url":"https://api.github.com/users/samuela/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/plotly/plotly.js/labels/type:%20bug","name":"type: bug","color":"e31a1c"},{"url":"https://api.github.com/repos/plotly/plotly.js/labels/type:%20performance","name":"type: performance","color":"fdbf6f"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-20T22:26:27Z","updated_at":"2016-09-21T13:33:36Z","closed_at":null,"body":"I'm working in a Jupyter notebook with a number of plotly surface plots. I've noticed that after 4-5 plots are generated, my computer slows down considerably. Upon review, I realized that Chrome was consuming all of my 16gb of memory. Closing the Chrome tab with the plots freed up 12gb of memory.\r\n\r\nHere's some simple code that attempts to reproduce the error. Apologies in advance if it crashes your machine.\r\n\r\n```python\r\nimport numpy as np\r\n\r\nimport plotly\r\nimport plotly.graph_objs as go\r\n\r\nimport pandas as pd\r\n\r\nplotly.offline.init_notebook_mode(connected=True)\r\n\r\nfor _ in range(50):\r\n    data = [go.Surface(z=np.random.randn(50, 50))]\r\n    layout = go.Layout(\r\n        width=500,\r\n        height=500,\r\n        margin=dict(\r\n            l=65,\r\n            r=50,\r\n            b=65,\r\n            t=90\r\n        )\r\n    )\r\n    fig = go.Figure(data=data, layout=layout)\r\n    plotly.offline.iplot(fig)\r\n```\r\n\r\nRunning it once is fine. A chunk of memory is used. No problem. But then if the same cell is reevaluated, removing the previous plots and replacing them with new ones, the memory only continues to climb. (You may need to rerun a few times to get the full effect.) We should expect totally memory usage to remain constant more or less. But things just keep climbing.\r\n\r\nI'm running Chrome 53.0.2785.116 on Mac OS X 10.11.6."},"comment":{"url":"https://api.github.com/repos/plotly/plotly.js/issues/comments/248613506","html_url":"https://github.com/plotly/plotly.js/issues/957#issuecomment-248613506","issue_url":"https://api.github.com/repos/plotly/plotly.js/issues/957","id":248613506,"user":{"login":"etpinard","id":6675409,"avatar_url":"https://avatars.githubusercontent.com/u/6675409?v=3","gravatar_id":"","url":"https://api.github.com/users/etpinard","html_url":"https://github.com/etpinard","followers_url":"https://api.github.com/users/etpinard/followers","following_url":"https://api.github.com/users/etpinard/following{/other_user}","gists_url":"https://api.github.com/users/etpinard/gists{/gist_id}","starred_url":"https://api.github.com/users/etpinard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etpinard/subscriptions","organizations_url":"https://api.github.com/users/etpinard/orgs","repos_url":"https://api.github.com/users/etpinard/repos","events_url":"https://api.github.com/users/etpinard/events{/privacy}","received_events_url":"https://api.github.com/users/etpinard/received_events","type":"User","site_admin":false},"created_at":"2016-09-21T13:33:36Z","updated_at":"2016-09-21T13:33:36Z","body":"Thanks for the report.\r\n\r\nMemory management for WebGL trace type has been long-standing issue for us. Referencing https://github.com/plotly/plotly.py/issues/487 and https://github.com/plotly/plotly.js/issues/718.\r\n\r\nCan I ask what version of plotly.py are you using? If you're using plotly.py < `1.12.6`, I would recommend updating to the latest version. You should notice some improvements there coming from @monfera 's https://github.com/plotly/plotly.js/pull/724 and https://github.com/plotly/plotly.js/pull/726.\r\n\r\nThat said, even after updating, I suspect that some memory issues will remain (especially on pages with 4-5 WebGL graphs) . Unfortunately, fixing those issues will require a major changes in our WebGL code base which we planned in https://github.com/plotly/plotly.js/issues/949 but probably won't be ready for primetime before early 2017.\r\n"}}
{"actor":{"display_login":"etpinard"}}