Open juanep97 opened 1 year ago
Just wanted to say thank you for catching this and mentioning it!
I will add a test scenario, if you think it's useful; although I don't know if this will be a problem of astrometry or astrometry.net.
I've just noticed that it seems @rlancaste ran across maybe the same memory leaks when adapting Astrometry.net for StellarSolver: https://github.com/dstndstn/astrometry.net/issues/183#issuecomment-638893225
Perhaps @aMarcireau could compare notes to find and fix them if and when it's a priority!
Yes, there definitely were some memory leaks. I had to correct a bunch of them as best I could so that KStars did not have significant memory leaks when plate solving. I cannot guarantee that every change I made was the best solution, but I tried my best. I think I managed to fix all the biggest ones. There also were some issues I never resolved, but it got to the point where they were pretty small issues and did not significantly affect performance.
Yes, there definitely were some memory leaks. I had to correct a bunch of them as best I could so that KStars did not have significant memory leaks when plate solving.
Do you happen to know whether any of them got up-streamed into the original astrometry.net repo?
Aside - thank you for your work! I've only recently taken up any kind of active interest in astrophotography and the first thing I realized is that 99% of the barrier to entry is the effort in realizing which tools do what you're trying to accomplish and figuring out how to jam them all together. Stellar solver in Kstars really goes a long way on that front.
So I know at least one person was mentioning that they wanted to try to upstream some of my changes. I do not have the time to do that now. I am a full time Physics and Computer Science teacher. I had to the time to do StellarSolver during the pandemic, but now that we are back full time and I have a couple of other projects I have been working on, I haven't had time for as much open source coding.
Sorry, I'm quite busy lately with academic life... I add a note here for when I have time to dive and check the origin of the memory leak. I realized (2) below also happens:
It seems to be related to the loading of index files, maybe memory is not released after loading them
Repeated calls to the astrometry solver (hundreds) end up increasing the allocated memory until it overflow (currently circumvented it in my script by spawning a forked process for each field; which frees the allocated memory).
Versions:
Steps to reproduce:
(thanks for the nice module, btw)