Yea, adding the appropriate close methods did not make a difference.
Here is the loop I am running:
*foreach(String curGroup3Name in curGroup3Names)
{
H5FileId hdfFile = H5F.open(pathToHDF, H5F.OpenMode.ACC_RDONLY);
H5DataSetId curDataset = H5D.open(hdfFile, curGroup1Name + "/" +
curGroup2Name + "/" + curGroup3Name + "/dataset");
float[] curDatasetArray = GetDatasetArray(curDataset);
H5D.close(curDataset);
H5F.close(hdfFile);
MessageBox.Show("Finished dataset for tile " + curTileName + "...");
}*
Just as in my other code, I get to about the seventh iteration and i
hangs on the call to:
*H5D.read(dataset, datasetNativeType, new H5Array<float>(dArray));*
...that happens inside the method getDatasetArray(curDataset). That
code is listed below...
Any ideas anyone?
Thanks again,
DB
On 9/19/2011 3:31 PM, Donald Brandon wrote:
Hey, Scott. Yea, I caught that after I sent the e-mail. I am writing
a test program now. I will let you know if that solved it.
Thanks,
DB
On 9/19/2011 3:27 PM, Mitchell, Scott - IS wrote:
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
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org