Possible memory leak with helical symmetry

21 views
Skip to first unread message

Raven Gonsoulin

unread,
May 15, 2026, 11:27:16 AMMay 15
to EMAN2
Hello again,

I noticed something peculiar in between killing 'e2spt_refine_new.py' jobs. Using <htop>, I could see that the baseline Swp usage on our machines would gradually increase (even when killing the project manager itself and checking with <ps>).

In a previous related discussion it was mentioned the possibility of "a bug somewhere, possibly relating to the helical symmetry, causing memory leaks of some sort" (https://groups.google.com/g/eman2/c/ctAkyrLEVcM/m/G9WKv75hAAAJ).

During a 'e2spt_refine_new.py' refinement, it looks like that indeed the Mem usage gradually increases. In particular, during the subtilt alignment step ('e2spt_align_subtlt.py').

Let me know if there is any other info I could provide that would be helpful.

Thanks,
Raven


Steve Ludtke

unread,
May 20, 2026, 9:32:49 PMMay 20
to em...@googlegroups.com
Unfortunately this sort of thing is very difficult to debug unless we have an easy way to replicate it...   I'm not saying there _is_ a memory leak, just that it's a possibility. Unfortunately, most modern memory management systems are "lazy" in that when you release allocated memory it doesn't always immediately return to the free memory pool. Swapping also can be very hard to gague, as modern operating systems may swap when they don't actually need to, ostensibly to achieve better performance. This is why most linux machines used for scientific computing are configured with zero swap space nowadays (if there isn't any it can't be used).   

Why would it do that, you ask?   Let's say you're running windows and have photoshop running and it's eating up 20 of the 32 GB on your desktop machine. You then open Illustrator to do some work with it. Say Illustrator only needs 10 GB of RAM itself, however, it's accessing 8 GB of files on disk, which it may need to access repeatedly. One of the things the operating system does with RAM is to cache disk files in RAM for faster access. Ostensibly it only does this when the memory is free. With modern swapping policies, it may decide that since you're actively using Illustrator right now, it would make sense to swap 8 GB of the RAM Photoshop is using to disk, so it can use the 8 GB to buffer the files you need to access in Illustrator, in case you need to read/write them repeatedly. This will make Illustrator run a lot faster, but when you switch back to Photoshop you'll have to wait a few seconds for it to swap its 8GB back in from disk. This goes under the assumption that you have multiple things open, but are really only using one of them at a time.

If you extend this behavior to Linux workstations doing scientific computing, though, where you DO have big jobs using most of the RAM running, then this aggressive swapping behavior can make the jobs run MUCH slower because it may take part of your job running in the background and swap it out to disk in favor of making other things potentially faster. 

--
--
----------------------------------------------------------------------------------------------
You received this message because you are subscribed to the Google
Groups "EMAN2" group.
To post to this group, send email to em...@googlegroups.com
To unsubscribe from this group, send email to eman2+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/eman2

---
You received this message because you are subscribed to the Google Groups "EMAN2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eman2+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/eman2/4cda8bee-bb6e-4f3a-9703-45f999f20bb6n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages