memory leak associated with getFileDataAsRegularArray()
In v1.38.5, I am seeing a large memory leak when repeatedly calling an astronomical reprojection routine (mProjectPP), which takes an two memory-based files as input and generates a new memory-based file as output. The output file is always unlink()'ed before each successive call. If I call mProjectPP 72 times, I see 70 retained chunks of 8.4Mb each, for a total leak of 580Mb, as shown below:
The previous output files were definitely removed (only the input file and final output file are still in the mem file system), as shown in this file list:
The mProjectPP code is basically clean according to Linux valgrind (a few thousand possibly leaked bytes), so I am at a loss about where to look for this problem. Any advice would be appreciated.
FWIW, upgrading to v1.38.22 has no effect on this memory leak (although, subjectively, processing seems to be quite a bit faster -- thanks!)
Ah, this is almost certainly caused by some process holding open the deleted files ... so not an Emscripten problem ...