comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Container/Holder Destruction
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Container/Holder Destruction [message #45606] Mon, 19 September 2005 16:46
IDLmastertobe is currently offline  IDLmastertobe
Messages: 54
Registered: June 2004
Member
hi, i am still pretty confused on which object is taking up all my RAM. I
have 1GB of installed RAM. When I worked with the smaller file with
dimension 52x52x52, i found it created about 50 objects to visualize.
When I worked on the larger file with 257x257x257, it created 47 objects.
But the large file ate up all the RAM before it even appeared. I am just
wondering if there is any call or procedure that enable me to find out
which object or array,etc is taking up all my RAM. Is there such a
function? with detailed memory usage of its component? anyone has any
suggestion on how I can discover the culprit? Thanks
Re: Container/Holder Destruction [message #45615 is a reply to message #45606] Mon, 19 September 2005 06:35 Go to previous message
Antonio Santiago is currently offline  Antonio Santiago
Messages: 201
Registered: February 2004
Senior Member
IDLmastertobe wrote:
> Thanks for the reply.
>
> I check my heap and found no memory leak in the heap. I am trying to
> visualize 3D data and the cleanup won't be called until the graphic window
> is closed. When I was working with a 3D data with dimension 52x52x52, the
> program works fine. When I used data with dimension 257x257x257, the
> memory runs out BEFORE the 3D image appeared. In this case, I can't see
> how memory leak will affect me since the cleanup won't be called until I
> finish visualing and close the 3D graphic window, which does not even
> appear right now. I am using a lot of objects and saving many of them in
> a state structure. I think the size of the objects are building up pretty
> quickly and eating up my RAM. Am I missing some important information on
> where I am wasting my memory? Does anyone have any suggestion on how I
> can "save" some memory? I cannot destroy any object BEFORE i close the 3D
> graphic window because the object information is needed for the 3D
> graphics. But if I don't destroy some of them, I don't think there is
> enough RAM for the graphics in my case right now. Thanks for your help.
> I appreciate your time.
>

I dont know what your problem is but I have worked with objects and
object graphics with data bigger than 257x257x257 and there is no problem.

Perhaps you have problems in functions that creates your objects or
graphic object and creates many times the same objects.



--
-----------------------------------------------------
Antonio Santiago P�rez
( email: santiago<<at>>grahi.upc.edu )
( www: http://www.grahi.upc.edu/santiago )
( www: http://asantiago.blogsite.org )
-----------------------------------------------------
GRAHI - Grup de Recerca Aplicada en Hidrometeorologia
Universitat Polit�cnica de Catalunya
-----------------------------------------------------
Re: Container/Holder Destruction [message #45616 is a reply to message #45615] Mon, 19 September 2005 06:17 Go to previous message
IDLmastertobe is currently offline  IDLmastertobe
Messages: 54
Registered: June 2004
Member
Thanks for the reply.

I check my heap and found no memory leak in the heap. I am trying to
visualize 3D data and the cleanup won't be called until the graphic window
is closed. When I was working with a 3D data with dimension 52x52x52, the
program works fine. When I used data with dimension 257x257x257, the
memory runs out BEFORE the 3D image appeared. In this case, I can't see
how memory leak will affect me since the cleanup won't be called until I
finish visualing and close the 3D graphic window, which does not even
appear right now. I am using a lot of objects and saving many of them in
a state structure. I think the size of the objects are building up pretty
quickly and eating up my RAM. Am I missing some important information on
where I am wasting my memory? Does anyone have any suggestion on how I
can "save" some memory? I cannot destroy any object BEFORE i close the 3D
graphic window because the object information is needed for the 3D
graphics. But if I don't destroy some of them, I don't think there is
enough RAM for the graphics in my case right now. Thanks for your help.
I appreciate your time.
Re: Container/Holder Destruction [message #45617 is a reply to message #45616] Mon, 19 September 2005 04:22 Go to previous message
Antonio Santiago is currently offline  Antonio Santiago
Messages: 201
Registered: February 2004
Senior Member
IDLmastertobe wrote:
> Hi, I am objects in my code and trying to destroy them after using to avoid
> memory leaks. I have created many objects and to destroy them, I created
> another holder object using IDLgrContainer, I am just wondering if I
> destroy this holder object, would all the objects I added into this holder
> object be destroyed as well? or I need to destroy everything one by one?
> Thanks.
>

Your question has a simple response, make a test:

PRO test

o1 = OBJ_NEW('IDLgrImage')
o2 = OBJ_NEW('IDLgrImage')
o3 = OBJ_NEW('IDLgrImage')
o4 = OBJ_NEW('IDLgrImage')

c = OBJ_NEW('IDL_Container')
c->Add, [o1, o2, o3, o4]

print, 'Num object = ',c->Count()
HELP, /HEAP

OBJ_DESTROY, c
print, 'Container destroyed'
HELP, /HEAP
END


When you destroys an IDL_Container it executes the 'cleanup' method of
the holded objects.

Some is interesting destroy the container but not the objects inside it
(because another object has the same reference). Then is needes execute:

c->Remove, /ALL
OBJ_DESTROY, c


Bye.

PD: Take a look at my web page (this is not spam :) ) i have some litlle
clases for IDL that can simplify the OO programer life in IDL.

--
-----------------------------------------------------
Antonio Santiago P�rez
( email: santiago<<at>>grahi.upc.edu )
( www: http://www.grahi.upc.edu/santiago )
( www: http://asantiago.blogsite.org )
-----------------------------------------------------
GRAHI - Grup de Recerca Aplicada en Hidrometeorologia
Universitat Polit�cnica de Catalunya
-----------------------------------------------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Help me plz abt this c program
Next Topic: Re: FILE_DIRNAME question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:13:51 PDT 2025

Total time taken to generate the page: 0.07662 seconds