Open xyzdxf opened 3 weeks ago
Hi @xyzdxf
Thanks for sharing this. My memory is vague but I think something like this has come up before, and it may have had something to do with JAX's storage of compiled functions.
I think if you put: jax.clear_caches()
within the loop after each call it could solve this issue. Obviously you don't always want to do this if you're genuinely re-using compiled functions, but in this case some compiling is being done behind the scenes and isn't even being re-used anyway.
Informations
What is the current behavior?
When running jobs with DynamicsBackend, the memory usage keeps increasing.![mem](https://github.com/user-attachments/assets/ff0fe7e1-7ab1-4d55-8a5e-9e0c6e3bec52)
Steps to reproduce the problem
Create a file named
pulse_memory.py
What is the expected behavior?
The memory usage should not keep increasing ...
Suggested solutions