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

Home » Public Forums » archive » Memory benefit from subroutines
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Memory benefit from subroutines [message #55328] Fri, 10 August 2007 10:24
MarioIncandenza is currently offline  MarioIncandenza
Messages: 231
Registered: February 2005
Senior Member
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.
[Message index]
 
Read Message
Previous Topic: Re: Removing bad data from an array
Next Topic: Bigger image from Slicer3?

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

Current Time: Fri Oct 10 17:51:26 PDT 2025

Total time taken to generate the page: 1.44301 seconds