Author Topic: Memory leak in subframe selector 0.96 ????  (Read 3145 times)

Offline vol.patrick

  • Newcomer
  • Posts: 6
Memory leak in subframe selector 0.96 ????
« on: 2013 December 19 23:22:15 »
Hi

I'am running W7 4Go and PI 1.8 (1071).
I tried  to use subframeselector with 300+ images from a DSLR.
The measure part is fine.


However, when I output subframes (Copy to approved directory), I get an "out of memory" error.
It appears that the amount of virtual memory that PI uses grows dramatically during the copy of approved frames(able to see it on monitor resources). I modified the maximum amount of Virtual memory to a maximum of 32Gb .It copied more files, but I still get the same message later on(copy of 165images out of 300+), with PI using more than 32Gb of virtual memory. :surprised:

Patrick



Offline AstroScience

  • PixInsight Addict
  • ***
  • Posts: 169
Re: Memory leak in subframe selector 0.96 ????
« Reply #1 on: 2013 December 19 23:59:29 »
Can confirm that this is also happens on my Win7 x64 system.

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Memory leak in subframe selector 0.96 ????
« Reply #2 on: 2013 December 20 02:44:08 »
There is no memory leak. This is just a JavaScript garbage collection problem.

Basically, to copy a file the script loads its contents in memory and then writes them to the destination file. Although the script does this by chunks of 1 MiB, the JavaScript engine optimizes the process for pure execution speed by not releasing any of the ByteArray objects used to load file data. As a result, you end up with the whole data of a large set of image files plus lots of auxiliary structures allocated in RAM and, when RAM exhausts, in virtual memory.

Revising the script's source code, I see where this problem can be fixed very easily. I'll write to Mike to see if we can fix this issue as soon as possible. Sorry for the inconvenience.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline vol.patrick

  • Newcomer
  • Posts: 6
Re: Memory leak in subframe selector 0.96 ????
« Reply #3 on: 2013 December 20 03:12:55 »
Thanks Juan,

The workaround is to manually copy the files and then to manually delete the un-wanted files.
Obviously that implies to make a note of the bad files.
The downside is that we can't compute the SNR keyword.

Patrick