The example is garbled but offers a few clues. Where are you closing the pnt_ch->filespace_id
handle that you acquire in H5Dget_space
? If you keep re-assigning that w/o previously closing the existing one, that’s a memory leak right there. Generally, the most common source of the kind of leakage you are seeing is a lack of handle discipline. “You acquire a handle, you own it (and the resources that go with it).” (Colin Powell) Make sure that there is a matching H5*close
with each hid_t
handle you acquire. Use H5Fget_obj_count
(https://portal.hdfgroup.org/display/HDF5/H5F_GET_OBJ_COUNT) to check for open handles. Use H5F_OBJ_ALL
for types
. Check that before shutting down your application! If the count returned is greater than one (you have at least one open file handle), that typically signals trouble. G.