Hi Eric,
Thank you for the quick response!! Unfortunately gc.collect() does not help. Furthermore, when I run my script for only a few iterations, it is able to complete, but holds onto its 12 GB of memory, even when idle (technically it drops ~50 MB every few minutes). Relaunching chimeraX obviously fixes this. In the original chimera, it appears that there was a command to reclaim memory "chimera.update.checkForChanges()" but I can't find a chimeraX version. Resetting the Log barely drops the memory. Do you have any other ideas?
If it helps, I will describe my code below:
Register a function, which itself is made of 5 functions, that samples a cryo-EM map at given coordinates (about 520 coordinates) and prints to file. I try to call this function several dozen times via a .cxc file, with each call of the function consuming ~3 GB.
The general function flow is:
1. Define a list of coordinates along defined unit vectors (12 in total, combined with the inverse vectors).
2. Create chimeraX markers at these coordinates. (each vector is assigned a model number, each marker is a residue. Ex: along the x-axis, #10:1, #10:2, #10:3 ...)
3. From all markers, `measure mapvalues` and assign values to an attribute
4. Assign a string attribute to each marker, naming them.
5. Save mapvalue attribute to .defattr file. Likewise save the marker string names.
6. Delete all markers.
7. New: gc.collect()
Best regards,
:David