IDL new graphics memory leak? [message #93713] |
Tue, 04 October 2016 04:56  |
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   |
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   |
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  |
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!
|
|
|