Hey!
I’ve been working on a project that uses Panda3D (version 1.10.15) to animate atomistic simulations. Naturally, this has lead me to use the setPos() method to move the atoms around.
The issue I’m running into is that it seems that this method is seemingly caching previous positions leading to my machines memory being filled up and eventually crashing.
I came to this conclusion while playing around with the method. My simulation consists of 500 atoms being updated about 60 times a second. I then formed 3 different sets of coordinates that I would use with setPos() and ran 3 tests.
First test:
Coordinate set: taken directly from the atomistic simulation which gives effectively random positions with an “infinite” amount of possible positions
Result: Memory usage increased by about 30MB/s until crash
Second test:
Coordinate set: Created a list of 1000 possible coordinates (xyz ranging from 0 to 9)
Result: Memory usage remained constant
Third test:
Coordinate set: Created a list of 100k possible coordinates (xy ranging from 0 to 99 and z from 0 to 9)
Result: Memory usage increased by about 30MB/s until quickly slowing down and settling at around total usage of 466MB
Is there a way to disable this caching behavior that I haven’t spotted in the documentation or do I need to find another way to move my atoms around? Any suggestions are appreciated!