Dear HDF5 experts:
I've been investigating memory leaks in a program of mine, and then
found that the function H5LTopen_file_image is causing the leak. I
created a minimal example reproducing the problem, which just opens and
closes a file again and again and again, after reading the file into
memory only once, and one could see a clear memory build-up. Could
someone please verify that I'm not doing anything wrong?
Below is the minimal working example of the program. I tested it with
valgrind/massif, using the command:
$ valgrind --tool=massif ./LeakTest
And one could obviously see the memory rise. What I have in my
application is a file in memory (as in the example) that I need to read
without modifying it or releasing it. The only way I was able to get rid
of the memory leak, is by using the flag H5LT_FILE_IMAGE_OPEN_RW, which
means that the image will be copied, and I'm trying to avoid that. Is
this a bug in the HDF5 library? Or am I doing something wrong?