From: Michael Lewis (mlewis++at++evl.uic.edu)
Date: 07/17/2001 11:00:07
Hello
I have a pfNode that was created with the pfdLoadFile using an iv or pfb
model
My problem is trying to get the actual memory size of the whole tree
under the pfNode. My
subroutine listed underneath recursively gets the size of all the
pfGeosets and sums up all the
sizes of the geosets. However my total size result is no where near the
actual memory of the
loaded pfNode. From doing an amallinfo before and after loading the
pfNode I get a memory size
much higher than when I recursively get the sizes. But doing amallinfo
before or after a load can
be unreliable especially if an object has been deleted before.
Any suggestions in how to consistently record the true memory size of a
loaded pfNode object. Should
I add anything more to my function below.
void getMemSize(pfNode *node)
{
int i;
if (node->isOfType(pfGeode::getClassType()))
{
pfGeode *geode = (pfGeode *)node;
for (i=0; i < geode->getNumGSets(); i++)
{
pfGeoSet *gset = geode->getGSet(i);
int geoSetSize = gset->getSize();
totalSize = totalSize + geoSetSize; // totalSize
is a global variable
}
}
else if (node->isOfType(pfGroup::getClassType()))
{
pfGroup *group = (pfGroup *)node;
for (i=0; i < group->getNumChildren(); i++)
{
getMemSize(group->getChild(i));
}
}
}
Also I notices that the getSize() function only works in the 2.4 using
the debug libraries. Is there any intent
to make this a main stream call.
Thanks
Michael J. Lewis
mlewis++at++evl.uic.edu
This archive was generated by hypermail 2b29 : Tue Jul 17 2001 - 11:00:03 PDT