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

Home » Public Forums » archive » Re: Asynchronous IDL_IDLBridge causing 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
Re: Asynchronous IDL_IDLBridge causing memory leak [message #72310] Tue, 31 August 2010 08:31 Go to next message
Seth Johnson is currently offline  Seth Johnson
Messages: 4
Registered: August 2010
Junior Member
On Aug 30, 10:02 am, Seth Johnson <seth.spjoh...@gmail.com> wrote:
> On Aug 30, 8:35 am, Bennett <juggernau...@gmail.com> wrote:
>
>
>
>> On Aug 27, 2:39 pm, Seth Johnson <seth.spjoh...@gmail.com> wrote:
>
>>> Sorry, I realized there was a mistake in the second example, it should
>>> be:
>
>>> oBridge=OBJARR(5)
>>> FOR chain=0,4 DO BEGIN oBridge[chain]=Obj_New('IDL_IDLBridge')
>
>>> FOR i=0,999 DO BEGIN
>>>    FOR chain=0,4 do BEGIN
>>>       a=bindgen(1E4,1E3)
>>>       oBridge[chain]->SetVar,'a',a
>>>       oBridge[chain]->Execute,'a=a+a',/NOWAIT
>>>    ENDFOR
>
>>>    FOR chain=0,4 DO WHILE oBridge[chain]->Status() NE 0 DO wait,0.0001
>>> ENDFOR
>>> OBJ_DESTROY,oBridge
>
>>> I do not destroy the objects until the very end as there are
>>> parameters and routines that need to be loaded into each IDL_IDLBridge
>>> for various computations in addition to parameters that change with
>>> every iteration.  Destroying and recreating would be a rather large
>>> boon to processing time while the initial problem caused by
>>> asynchronous operation still remains.
>
>> I've noticed that leak in 6.3 but not in 7.0+.  Which version are you
>> running?
>
> Strange, I have tested this on IDL versions 7.0 and 7.1, both of which
> produce the leak.  Could the cause perhaps lie in the setup or one of
> the required packages?  I have noticed while testing on different
> machines that 7.0 and 7.1 use different versions of the shared library
> libstdc++.so.

It is not the most elegant of solutions, but I have found a temporary
work around for the memory leak. Rather than calling the asynchronous
processes from the main routine, I create a single child process that
then creates its own children and performs the asynchronous calls
similar to:

oBridge=Obj_New('IDL_IDLBridge')
oBridge->SetVar,'a',a
oBridge->Execute,"oBridge=Obj_New('IDL_IDLBridge')"
oBridge->Execute,"oBridge->SetVar,'a',a"
FOR i=0,999 DO BEGIN
tmp=memory()
oBridge->Execute,"oBridge->Execute,'a=a+a',/NOWAIT"
print,memory(/high)
WHILE oBridge->GetVar('oBridge->Status()') NE 0 DO wait,0.0001
ENDFOR

The child process (and its children) do not appear to leak memory as
the parent call does. I find it rather peculiar that this method
works, even after loading the IDL startup file into the child
processes.
Re: Asynchronous IDL_IDLBridge causing memory leak [message #72328 is a reply to message #72310] Mon, 30 August 2010 07:02 Go to previous messageGo to next message
Seth Johnson is currently offline  Seth Johnson
Messages: 4
Registered: August 2010
Junior Member
On Aug 30, 8:35 am, Bennett <juggernau...@gmail.com> wrote:
> On Aug 27, 2:39 pm, Seth Johnson <seth.spjoh...@gmail.com> wrote:
>
>
>
>> Sorry, I realized there was a mistake in the second example, it should
>> be:
>
>> oBridge=OBJARR(5)
>> FOR chain=0,4 DO BEGIN oBridge[chain]=Obj_New('IDL_IDLBridge')
>
>> FOR i=0,999 DO BEGIN
>>    FOR chain=0,4 do BEGIN
>>       a=bindgen(1E4,1E3)
>>       oBridge[chain]->SetVar,'a',a
>>       oBridge[chain]->Execute,'a=a+a',/NOWAIT
>>    ENDFOR
>
>>    FOR chain=0,4 DO WHILE oBridge[chain]->Status() NE 0 DO wait,0.0001
>> ENDFOR
>> OBJ_DESTROY,oBridge
>
>> I do not destroy the objects until the very end as there are
>> parameters and routines that need to be loaded into each IDL_IDLBridge
>> for various computations in addition to parameters that change with
>> every iteration.  Destroying and recreating would be a rather large
>> boon to processing time while the initial problem caused by
>> asynchronous operation still remains.
>
> I've noticed that leak in 6.3 but not in 7.0+.  Which version are you
> running?

Strange, I have tested this on IDL versions 7.0 and 7.1, both of which
produce the leak. Could the cause perhaps lie in the setup or one of
the required packages? I have noticed while testing on different
machines that 7.0 and 7.1 use different versions of the shared library
libstdc++.so.
Re: Asynchronous IDL_IDLBridge causing memory leak [message #72331 is a reply to message #72328] Mon, 30 August 2010 05:35 Go to previous messageGo to next message
Juggernaut is currently offline  Juggernaut
Messages: 83
Registered: June 2008
Member
On Aug 27, 2:39 pm, Seth Johnson <seth.spjoh...@gmail.com> wrote:
> Sorry, I realized there was a mistake in the second example, it should
> be:
>
> oBridge=OBJARR(5)
> FOR chain=0,4 DO BEGIN oBridge[chain]=Obj_New('IDL_IDLBridge')
>
> FOR i=0,999 DO BEGIN
>    FOR chain=0,4 do BEGIN
>       a=bindgen(1E4,1E3)
>       oBridge[chain]->SetVar,'a',a
>       oBridge[chain]->Execute,'a=a+a',/NOWAIT
>    ENDFOR
>
>    FOR chain=0,4 DO WHILE oBridge[chain]->Status() NE 0 DO wait,0.0001
> ENDFOR
> OBJ_DESTROY,oBridge
>
> I do not destroy the objects until the very end as there are
> parameters and routines that need to be loaded into each IDL_IDLBridge
> for various computations in addition to parameters that change with
> every iteration.  Destroying and recreating would be a rather large
> boon to processing time while the initial problem caused by
> asynchronous operation still remains.

I've noticed that leak in 6.3 but not in 7.0+. Which version are you
running?
Re: Asynchronous IDL_IDLBridge causing memory leak [message #72348 is a reply to message #72331] Fri, 27 August 2010 11:39 Go to previous messageGo to next message
Seth Johnson is currently offline  Seth Johnson
Messages: 4
Registered: August 2010
Junior Member
Sorry, I realized there was a mistake in the second example, it should
be:

oBridge=OBJARR(5)
FOR chain=0,4 DO BEGIN oBridge[chain]=Obj_New('IDL_IDLBridge')

FOR i=0,999 DO BEGIN
   FOR chain=0,4 do BEGIN
a=bindgen(1E4,1E3)
     oBridge[chain]->SetVar,'a',a
     oBridge[chain]->Execute,'a=a+a',/NOWAIT
   ENDFOR

   FOR chain=0,4 DO WHILE oBridge[chain]->Status() NE 0 DO wait,0.0001
ENDFOR
OBJ_DESTROY,oBridge

I do not destroy the objects until the very end as there are
parameters and routines that need to be loaded into each IDL_IDLBridge
for various computations in addition to parameters that change with
every iteration. Destroying and recreating would be a rather large
boon to processing time while the initial problem caused by
asynchronous operation still remains.
Re: Asynchronous IDL_IDLBridge causing memory leak [message #82756 is a reply to message #72310] Fri, 18 January 2013 09:56 Go to previous messageGo to next message
Russell Ryan is currently offline  Russell Ryan
Messages: 122
Registered: May 2012
Senior Member
Forgive me for waking the dead and releasing the zombie posts. But I've noticed a similar behavior on IDL 8.1. From a little testing, I've found that if I put calls to systime() and memory() on either side of the Bridge->Execute,/nowait call I can see (1) the time to start an asynchronous call and (2) it's memory usage increase with time. I'll try implementing this ugly-looking work around and see what ITT has to say about it?

-Russell



On Tuesday, August 31, 2010 11:31:59 AM UTC-4, Seth Johnson wrote:
> On Aug 30, 10:02 am, Seth Johnson <seth.spjoh...@gmail.com> wrote:
>> On Aug 30, 8:35 am, Bennett <juggernau...@gmail.com> wrote:
>>
>>
>>
>>> On Aug 27, 2:39 pm, Seth Johnson <seth.spjoh...@gmail.com> wrote:
>>
>>>> Sorry, I realized there was a mistake in the second example, it should
>>>> be:
>>
>>>> oBridge=OBJARR(5)
>>>> FOR chain=0,4 DO BEGIN oBridge[chain]=Obj_New('IDL_IDLBridge')
>>
>>>> FOR i=0,999 DO BEGIN
>>>>    FOR chain=0,4 do BEGIN
>>>>       a=bindgen(1E4,1E3)
>>>>       oBridge[chain]->SetVar,'a',a
>>>>       oBridge[chain]->Execute,'a=a+a',/NOWAIT
>>>>    ENDFOR
>>
>>>>    FOR chain=0,4 DO WHILE oBridge[chain]->Status() NE 0 DO wait,0.0001
>>>> ENDFOR
>>>> OBJ_DESTROY,oBridge
>>
>>>> I do not destroy the objects until the very end as there are
>>>> parameters and routines that need to be loaded into each IDL_IDLBridge
>>>> for various computations in addition to parameters that change with
>>>> every iteration.  Destroying and recreating would be a rather large
>>>> boon to processing time while the initial problem caused by
>>>> asynchronous operation still remains.
>>
>>> I've noticed that leak in 6.3 but not in 7.0+.  Which version are you
>>> running?
>>
>> Strange, I have tested this on IDL versions 7.0 and 7.1, both of which
>> produce the leak.  Could the cause perhaps lie in the setup or one of
>> the required packages?  I have noticed while testing on different
>> machines that 7.0 and 7.1 use different versions of the shared library
>> libstdc++.so.
>
> It is not the most elegant of solutions, but I have found a temporary
> work around for the memory leak. Rather than calling the asynchronous
> processes from the main routine, I create a single child process that
> then creates its own children and performs the asynchronous calls
> similar to:
>
> oBridge=Obj_New('IDL_IDLBridge')
> oBridge->SetVar,'a',a
> oBridge->Execute,"oBridge=Obj_New('IDL_IDLBridge')"
> oBridge->Execute,"oBridge->SetVar,'a',a"
> FOR i=0,999 DO BEGIN
> tmp=memory()
> oBridge->Execute,"oBridge->Execute,'a=a+a',/NOWAIT"
> print,memory(/high)
> WHILE oBridge->GetVar('oBridge->Status()') NE 0 DO wait,0.0001
> ENDFOR
>
> The child process (and its children) do not appear to leak memory as
> the parent call does. I find it rather peculiar that this method
> works, even after loading the IDL startup file into the child
> processes.
Re: Asynchronous IDL_IDLBridge causing memory leak [message #82985 is a reply to message #82756] Sat, 26 January 2013 10:27 Go to previous messageGo to next message
Russell Ryan is currently offline  Russell Ryan
Messages: 122
Registered: May 2012
Senior Member
I've been emailing folks at Exelis about this. They've now issued a formal bug report to the engineers. I'll repost if I learn of any answers...

R

On Friday, January 18, 2013 12:56:19 PM UTC-5, rr...@stsci.edu wrote:
> Forgive me for waking the dead and releasing the zombie posts. But I've noticed a similar behavior on IDL 8.1. From a little testing, I've found that if I put calls to systime() and memory() on either side of the Bridge->Execute,/nowait call I can see (1) the time to start an asynchronous call and (2) it's memory usage increase with time. I'll try implementing this ugly-looking work around and see what ITT has to say about it?
>
>
>
> -Russell
>
>
>
>
>
>
>
> On Tuesday, August 31, 2010 11:31:59 AM UTC-4, Seth Johnson wrote:
>
>> On Aug 30, 10:02 am, Seth Johnson <seth.spjoh...@gmail.com> wrote:
>
>>> On Aug 30, 8:35 am, Bennett <juggernau...@gmail.com> wrote:
>
>>>
>
>>>
>
>>>
>
>>>> On Aug 27, 2:39 pm, Seth Johnson <seth.spjoh...@gmail.com> wrote:
>
>>>
>
>>>> > Sorry, I realized there was a mistake in the second example, it should
>
>>>> > be:
>
>>>
>
>>>> > oBridge=OBJARR(5)
>
>>>> > FOR chain=0,4 DO BEGIN oBridge[chain]=Obj_New('IDL_IDLBridge')
>
>>>
>
>>>> > FOR i=0,999 DO BEGIN
>
>>>> >    FOR chain=0,4 do BEGIN
>
>>>> >       a=bindgen(1E4,1E3)
>
>>>> >       oBridge[chain]->SetVar,'a',a
>
>>>> >       oBridge[chain]->Execute,'a=a+a',/NOWAIT
>
>>>> >    ENDFOR
>
>>>
>
>>>> >    FOR chain=0,4 DO WHILE oBridge[chain]->Status() NE 0 DO wait,0.0001
>
>>>> > ENDFOR
>
>>>> > OBJ_DESTROY,oBridge
>
>>>
>
>>>> > I do not destroy the objects until the very end as there are
>
>>>> > parameters and routines that need to be loaded into each IDL_IDLBridge
>
>>>> > for various computations in addition to parameters that change with
>
>>>> > every iteration.  Destroying and recreating would be a rather large
>
>>>> > boon to processing time while the initial problem caused by
>
>>>> > asynchronous operation still remains.
>
>>>
>
>>>> I've noticed that leak in 6.3 but not in 7.0+.  Which version are you
>
>>>> running?
>
>>>
>
>>> Strange, I have tested this on IDL versions 7.0 and 7.1, both of which
>
>>> produce the leak.  Could the cause perhaps lie in the setup or one of
>
>>> the required packages?  I have noticed while testing on different
>
>>> machines that 7.0 and 7.1 use different versions of the shared library
>
>>> libstdc++.so.
>
>>
>
>> It is not the most elegant of solutions, but I have found a temporary
>
>> work around for the memory leak. Rather than calling the asynchronous
>
>> processes from the main routine, I create a single child process that
>
>> then creates its own children and performs the asynchronous calls
>
>> similar to:
>
>>
>
>> oBridge=Obj_New('IDL_IDLBridge')
>
>> oBridge->SetVar,'a',a
>
>> oBridge->Execute,"oBridge=Obj_New('IDL_IDLBridge')"
>
>> oBridge->Execute,"oBridge->SetVar,'a',a"
>
>> FOR i=0,999 DO BEGIN
>
>> tmp=memory()
>
>> oBridge->Execute,"oBridge->Execute,'a=a+a',/NOWAIT"
>
>> print,memory(/high)
>
>> WHILE oBridge->GetVar('oBridge->Status()') NE 0 DO wait,0.0001
>
>> ENDFOR
>
>>
>
>> The child process (and its children) do not appear to leak memory as
>
>> the parent call does. I find it rather peculiar that this method
>
>> works, even after loading the IDL startup file into the child
>
>> processes.
Re: Asynchronous IDL_IDLBridge causing memory leak [message #85408 is a reply to message #82985] Wed, 31 July 2013 12:21 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
Hi all,

Just FYI, the memory leak with the IDL_IDLBridge (bug 43494) has been fixed for IDL 8.3. IDL 8.3 should be out sometime later in the Fall.

Cheers,
Chris
ExelisVIS
Re: Asynchronous IDL_IDLBridge causing memory leak [message #85414 is a reply to message #85408] Thu, 01 August 2013 05:45 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Chris,
this is really good news for one of my projects!

Thanks,
Haje

On Wednesday, July 31, 2013 3:21:02 PM UTC-4, Chris Torrence wrote:
> Hi all,
>
>
>
> Just FYI, the memory leak with the IDL_IDLBridge (bug 43494) has been fixed for IDL 8.3. IDL 8.3 should be out sometime later in the Fall.
>
>
>
> Cheers,
>
> Chris
>
> ExelisVIS
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Is it possible to generate an error when it is tried to multiply matrix with different dimensions?
Next Topic: Re: Speeding up data crunching using IDL_IDLBridge with asychronous execution

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

Current Time: Wed Oct 08 09:22:00 PDT 2025

Total time taken to generate the page: 0.00727 seconds