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

Home » Public Forums » archive » IDL new graphics memory leak?
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
IDL new graphics memory leak? [message #93713] Tue, 04 October 2016 04:56 Go to next message
belkaraza is currently offline  belkaraza
Messages: 6
Registered: June 2016
Junior Member
Hey,

I have some enourmous problem with the amound of memory (virtual) IDL is using. I believe they are resulting from my extensive use of plots and images using the plot/image functions from IDL. If I omit them from my code my memory usage is on a normal level (1-8gb). If I want to include plots and images then my usage of memory will grow till it overloads the cluster I am working on (200-400 gb). Right after saving them I destroyed the objects via obj_destroy. This didn't solved my problem so I used heap_free. Still no improvment. Is there anything I am missing here? I am using IDL 8.3 on linux 64 bit.
rough sketch of my program structure:

read file (big image)

For
For
data analysis
Img=image(...)
img.save,....
destroy img
plot=plot()...
...
endfor
endfor
end


Thanks in advance!
B.R.
Re: IDL new graphics memory leak? [message #93715 is a reply to message #93713] Tue, 04 October 2016 05:39 Go to previous messageGo to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Tuesday, October 4, 2016 at 1:57:12 PM UTC+2, belk...@web.de wrote:
> Hey,
>
> I have some enourmous problem with the amound of memory (virtual) IDL is using. I believe they are resulting from my extensive use of plots and images using the plot/image functions from IDL. If I omit them from my code my memory usage is on a normal level (1-8gb). If I want to include plots and images then my usage of memory will grow till it overloads the cluster I am working on (200-400 gb). Right after saving them I destroyed the objects via obj_destroy. This didn't solved my problem so I used heap_free. Still no improvment. Is there anything I am missing here? I am using IDL 8.3 on linux 64 bit.
> rough sketch of my program structure:
>
> read file (big image)
>
> For
> For
> data analysis
> Img=image(...)
> img.save,....
> destroy img
> plot=plot()...
> ...
> endfor
> endfor
> end
>
>
> Thanks in advance!
> B.R.

Did you try img.close instead of obj_destroy? Did this give the same result?
Also, if I do a lot of images, I would change the loop to something like this:

Img=image(...) ;can also be empty or use dist(100) or whatever...
plt = plot(...)
For
For
data analysis
Img->setData, ...
img.save,....
plt->setData...
...
endfor
endfor
destroy img
end

This should also speed things up, but probably your bottleneck is not the the call to image(), but the "data analysis" before that.
Notice that you can call setData also pass x and y (as arrays).

Cheers,
Helder
Re: IDL new graphics memory leak? [message #93717 is a reply to message #93715] Tue, 04 October 2016 06:36 Go to previous messageGo to next message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 10/04/2016 02:39 PM, Helder wrote:
> On Tuesday, October 4, 2016 at 1:57:12 PM UTC+2, belk...@web.de wrote:
>> I have some enourmous problem with the amound of memory (virtual)
>> IDL is using. I believe they are resulting from my extensive use of plots
>> and images using the plot/image functions from IDL. If I omit them from
>> my code my memory usage is on a normal level (1-8gb). If I want to
>> include plots and images then my usage of memory will grow till it
>> overloads the cluster I am working on (200-400 gb). Right after saving
>> them I destroyed the objects via obj_destroy. This didn't solved my
>> problem so I used heap_free. Still no improvment. Is there anything I am
>> missing here? I am using IDL 8.3 on linux 64 bit.
>> rough sketch of my program structure:
>>
>> read file (big image)
>>
>> For
>> For
>> data analysis
>> Img=image(...)
>> img.save,....
>> destroy img
>> plot=plot()...
>> ...
>> endfor
>> endfor
>> end
> Did you try img.close instead of obj_destroy? Did this give the same result?
> Also, if I do a lot of images, I would change the loop to something like this:
>
> Img=image(...) ;can also be empty or use dist(100) or whatever...
> plt = plot(...)
> For
> For
> data analysis
> Img->setData, ...
> img.save,....
> plt->setData...
> ...
> endfor
> endfor
> destroy img
> end
>
> This should also speed things up, but probably your bottleneck is not
> the the call to image(), but the "data analysis" before that.
> Notice that you can call setData also pass x and y (as arrays).
hopefully Helder's comments are sufficient to reduce your memory
problems, if not,

help, /heap_variables
help, /shared_memory
help, /memory

might give you some hint on where the problem is.

Markus
Re: IDL new graphics memory leak? [message #93718 is a reply to message #93717] Wed, 05 October 2016 06:51 Go to previous message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
> On 10/04/2016 02:39 PM, Helder wrote:
>> Did you try img.close instead of obj_destroy? Did this give the same result?
>> Also, if I do a lot of images, I would change the loop to something like this:
>>

This is exactly the problem. A MWE shows it explicitly:

help, /heap, /brief ;to start

img = IMAGE(/test)
img.close
help, /heap, /brief ;anything on the heap?

img = IMAGE(/test)
OBJ_DESTROY, img
help, /heap, /brief ;Oops!

Further, the setData method Helder suggested will be very handy as well!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: display GeoTIFF image automatically using cgGeoMap
Next Topic: trying to convert map to graphic functions

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

Current Time: Wed Oct 08 09:10:41 PDT 2025

Total time taken to generate the page: 0.00500 seconds