Hey Donald,

You need to be close()ing your H5T type objects. I'm not sure if that's it, 
but....


Scott

From: [email protected] [mailto:[email protected]] On 
Behalf Of Donald Brandon
Sent: Monday, September 19, 2011 3:22 PM
To: HDF Users Discussion List
Subject: [Hdf-forum] memory issues when reading multiple datasets

Hello all:

I have another problem that I could use some help with.  In a nutshell, I have 
multiple datasets that I am trying to read arrays from and then work with those 
arrays one by one.  The structure of the .h5 file kinda look like this:

Group<root>
        Group<Group1>
                Group<GroupA>
                        Group<Group_a>
                                Dataset<1>
                        Group<group_b>
                                Dataset<1>
                Group<GroupB>
                        Group<Group_a>
                                Dataset<1>
                        Group<group_b>
                                Dataset<1>
        Group<Group2>
                        Group<Group_a>
                                Dataset<1>
                        Group<group_b>
                                Dataset<1>
                Group<GroupB>
                        Group<Group_a>
                                Dataset<1>
                        Group<group_b>
                                Dataset<1>

I am recursively going through each group and then executing code that looks 
something like this:

        public float[] GetDepthArray(H5DataSetId dataset)
        {
            H5DataTypeId datasetType = H5D.getType(dataset);
            H5T.H5TClass datasetClass = H5T.getClass(datasetType);
            H5DataTypeId datasetNativeType = H5T.getNativeType(datasetType, 
H5T.Direction.ASCEND);

            long storageSZ = H5D.getStorageSize(dataset);

            float[] dArray = new float[storageSZ];

            H5D.read(dataset, datasetNativeType, new H5Array<float>(dArray));

            return dArray;
        }

After about the seventh iteration, the code will fail with an 
AccessViolationException - "Attempted to read or write protected memory. This 
is often an indication that other memory is corrupt."

Anyone have advice as to whether or not I should be cleaning something up after 
each iteration that I am not seeing?  My system RAM seems to be un-phased after 
each iteration so at least it doesn't look like I am losing memory anywhere...

Thanks for the help!
DB




________________________________
This e-mail and any files transmitted with it may be proprietary and are 
intended solely for the use of the individual or entity to whom they are 
addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely 
those of the author and do not necessarily represent those of ITT Corporation. 
The recipient should check this e-mail and any attachments for the presence of 
viruses. ITT accepts no liability for any damage caused by any virus 
transmitted by this e-mail.
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to