Isolating HDF5 resource leak - best practices

Hi,

     I have a class which opens HDF file in the constructor and close HDF file in the destructor.

     All seems fine until I tried wrapping it up in a boost smart pointer in an OpenGL Glut application.

     The H5fclose() fails (was fine without the smart pointer) so I am in the process of tracking down any HDF5 resource leak due to my bad programming.

     Is there some mode we can build our application to use HDF5 libraries so that resources are track and some statistics can be printed/dump out for developers to isolate where resources were created but not freed ?

     I can use valgrind but I thought it there is something more specific to HDF5, I can cut down on the noise and focus only on HDF5 resources to start with.

Cheers

···

--
Nicholas Yue
Graphics - RenderMan, Visualization, OpenGL, HDF5
Custom Dev - C++ porting, OSX, Linux, Windows
http://au.linkedin.com/in/nicholasyue

I'd try to use the C++ api to simplify object management and reduce
occurrence of such issues. You might need the attached patch to work with
it though (git based pag, applies against 1.8.12).

0006-bugfix-in-c-api-prevent-passing-H5F_ACC_CREATE-to-H5.patch (987 Bytes)

···

On Sun, Nov 24, 2013 at 9:59 PM, Nicholas Yue <yue.nicholas@gmail.com>wrote:

Hi,

    I have a class which opens HDF file in the constructor and close HDF
file in the destructor.

    All seems fine until I tried wrapping it up in a boost smart pointer
in an OpenGL Glut application.

    The H5fclose() fails (was fine without the smart pointer) so I am in
the process of tracking down any HDF5 resource leak due to my bad
programming.

    Is there some mode we can build our application to use HDF5 libraries
so that resources are track and some statistics can be printed/dump out for
developers to isolate where resources were created but not freed ?

    I can use valgrind but I thought it there is something more specific
to HDF5, I can cut down on the noise and focus only on HDF5 resources to
start with.

Cheers

--
Nicholas Yue
Graphics - RenderMan, Visualization, OpenGL, HDF5
Custom Dev - C++ porting, OSX, Linux, Windows
http://au.linkedin.com/in/nicholasyue
NaiadTools on Vimeo

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@lists.hdfgroup.org
http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-
forum_lists.hdfgroup.org