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

Home » Public Forums » archive » Re: Memory benefit from subroutines
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: Memory benefit from subroutines [message #55315] Mon, 13 August 2007 03:06
m_schellens is currently offline  m_schellens
Messages: 31
Registered: February 2005
Member
On Aug 10, 7:24 pm, Ed Hyer <ejh...@gmail.com> wrote:
> Hi IDL Wizards,
>
> This has come up a few times, and I realized I don't know the answer:
>
> In the process of eliminating loops, I write a lot of routines that
> hover at the raw edge of what can be done in 32-bit IDL, in terms of
> memory usage. When a complicated routine runs out of memory, I usually
> do a
> IDL> help
> to determine if there's any cleanup I failed to do that could
> alleviate the crunch. Sometimes, though, the big memory hogs are
> outside the current loop. Here's pseudocode for that:
>
> outputarray=fltarr(2,10,2e6); 2e6 data from 200 files
> for ifile=0,199 do begin
> <crazy memory intensive operation>
> outputarray[i,ii,*]=result_1file
> endfor
>
> Now, if I put <crazy memory intensive operation> into a FUNCTION,
> would I gain any headroom on memory, because of descoping OUTPUTARRAY?
>
> Thanks for your sagacity,
>
> --Edward H.


You would gain nothing memory wise.
outputarray is still in memory even when out of scope
(and still even acessible with SCOPE_VARFETCH).
But probably the ASSOC function can be your friend here.

Cheers,
Marc
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Interpolate with findex no longer faster than interpol?
Next Topic: IDL resources

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

Current Time: Wed Oct 08 15:26:53 PDT 2025

Total time taken to generate the page: 0.00526 seconds