-
Notifications
You must be signed in to change notification settings - Fork 194
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
Possible memory leak in animate
#520
Comments
animate
animate
I've let this example go for many hours in chrome and firefox: Can you provide more evidence of a leak? How much is memory increasing and at what rate? What browser and operating system are you using? |
Sorry for the late response. Here are some more details: I'm running a Jupyter notebook in the WSL on Windows then open it in a browser to run the examples: The tutorial I'm running can be found here You'd need to have the Libra code installed - the instructions can be found [here] (https://github.com/Quantum-Dynamics-Hub/libra-code/tree/devel) - note the "devel" branch, but probably can be run without it. I had been using py3Dmol with the "animate" a while ago and this wasn't a problem indeed. As of now, regular visualization works fine, but when i use "animate" is starts building up the memory used. So here are my tests: Then I turn on the Now, even opening the notebook (without running it!) that contains an embedded py3Dmol animation causes the leak. |
Did you try the example I posted? Does the memory leak reproduce there? Is the extra memory in Chrome or Python? |
I experience a similar thing using animated structures but I have increased CPU usage if I reload the cell with the animation a few times. CPU usage does not go down again until I close the notebook in VS Code. I made a video of how the CPU usage increases: The code to reproduce is:
I am on windows 10 and I used both the Jupyter Notebook extension within VS Code and a normal jupyter notebook running as a tab in Microsoft Edge. After executing the cell a few times CPU usages increases quite heavily and goes down to idle as soon as the tab is closed (see video and the CPU usage of |
Does this mean you can't reproduce the problem in a regular browser environment? |
@dkoes I did not try what had been done above but I thought I add my description to the problem as it sounded similar. I get the increased CPU usage both in VS Code and in a Webkit browser (Edge). I also get the following warnings in the JS console. That might be related to the problem. |
Do you have issues with Chrome? |
Do you see these same error messages when loading the colab example I posted? What is the output of https://webglreport.com/?v=2 on your machine? |
I can't reproduce this in a local Jupyter notebook either (notebook server 6.0.3, python 3.8.5). I am increasingly skeptical that this is a 3Dmol.js issue as opposed to with something else in your stack (e.g. WSL GPU acceleration). Can you reproduce it outside of WSL? What process is increasing in memory, the browser or python? |
I tried on my windows notebook with jupyter running in wsl 1 and the browser running in the normal windows environment and on my Debian workstation running the jupyter server and browser natively. I can check the specific versions tomorrow and what happens if I kill the jupyter server keeping the browser open if you want. On my Linux workstation the Cpu usage was ~3% before execution of the cell multiple times and ~20% after. I'm on a 20 core, 128 gb RAM, 2x GPU machine. The cpu usage is from the browser process. |
I can also reproduce the problem in a hosted Jupyter Lab instance. It is definitely the browser process using the CPU ressources. PDydlGCYN9.mp4This is using Python 3.6.9, Jupyter Core 4.7.1, ipython, 7.16.1, ipykernel 5.5.0, jupyter client 6.1.12 |
Can you provide a link to the hosted instance? |
This might address Issue #520. It at least should reduce cpu usage when an animated cell is reloaded a bunch of times.
Sorry it is a private university resource running on jupyterlab 1 so you can unfortunately not get acces. Interestingly though I cannot reproduce the issue on MyBinder. I just tried it. |
Sure, go ahead and test. If you're using py3Dmol as long as you clear your cache you should get the new code. |
Is this resolved? Can the issue be closed? |
From my side it is resolved. Sorry about not getting back to you. Thanks again for adressing this. |
I'm using py3Dmol to animate the xyz trajectory file. I use py3Dmol v0.8.0 installed from the Anaconda cloud.
The code goes like
Here,
xyz
is a string containing the trajectory file.I noticed that RAM usage steadily increases when the above code is being executed in a Jupyter notebook. If I comment the
animate
line, there is no problem with the RAM.I wonder if this had been fixed already. Also, it would be great to have the corresponding fix available in the Conda installer. Please advise.
The text was updated successfully, but these errors were encountered: