H5F_OPEN/H5F_CLOSE apparent memory leak [message #76187] |
Fri, 20 May 2011 06:13 |
Juggernaut
Messages: 83 Registered: June 2008
|
Member |
|
|
I'm using IDL 7.1.1
Windows XP SP3
I have several HDF5s (some are very large...on the order of 10s of
gigabytes a piece) and I have some automated processing of datasets
inside these files I'm doing. After watching a few hundred files zip
by I started to see a memory leak (only recoverable by a restart of
the computer, reset and full_reset do not work). The leak eventually
eats up several gigabytes of memory if a few hundred files are loaded.
At first I thought I wasn't freeing a pointer or something to that
effect but after scouring through my code I couldn't find anything.
To separate the problem after I restarted my computer I simply took
those same files and ran the following test on them.
for i = 0, 299 do begin
fid = h5f_open(files[i])
h5f_close, fid
endfor
This simple for loop produced the memory leak in question. I could
actually watch the memory rise as the for loop progressed and was then
unable to reset the memory that IDL used without the full restart of
the computer.
If you run that for loop twice in a row, the second time will be
incredibly fast and no extra memory is used. My guess here is that it
has cached the file information at this point making it perform
quickly.
Has anyone else seen anything like this?
|
|
|