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

Home » Public Forums » archive » Re: HELP: Memory allocation problem
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: HELP: Memory allocation problem [message #1436] Tue, 09 November 1993 10:46
offenbrg is currently offline  offenbrg
Messages: 31
Registered: August 1993
Member
<FUHRER@IAP.unibe.ch> writes:

> I am posting this for Markus Heuer, who has not yet access to
> Internet / Usenet.

> "I am using IDL procedures/functions TRIANGULATE and TRIGRID with huge
> amounts of sample data on VAX/VMS (IDL Verson 3.0.0, VMS Version 5.5,
> machine: VAX 4000/90). To reduce the required array sizes, I split the
> rectangular resampling region into smaller subrectangles and collect the data
> lying in them. However, the arrays inevitably contain several 100'000 elements.
[Trimming]

> Questions:

> - Is the problem due to VAX system parameter settings? (The system manager
> already tuned system parameters).
> - Could it be a memory leakage problem in IDL procedures TRIANGULATE and
> TRIGRID (results of HELP, /MEMORY inserted in the loop above suggest this,
> although the discrepancies are small)?
> - Might there be problems with the VAX implementations of the C functions
> malloc and free presumably used in the implementations of TRIANGULATE
> and TRTGRID?
> - Is there a workaround for the memory allocation failure, APART FROM
> reducing large array sizes (which I really need in the application at hand)?

I'm not quite sure what you are trying to do, but it sounds like you are
running into the old IDL memory-fragmentation bugaboo. Essentially, if
you create the array:

x = fltarr(1000,1000)
and then you stuff and then you
x = 0
all of the memory allocated in the original 1000x1000x4B array is not freed.
As a result, when you next try to create another array:
y = fltarr(1000,1000)
IDL can not use the block freed up when you erased X. After a while of
manipulating large arrays, IDL finds itself with a lot of memory, but not
in large enough chunks to make a new array. When faced with this situation,
IDL reports an error. (It could "collect garbage," that is group together
the data in memory to make larger regions of free memory, but this is
tricky programming and even then won't necessarily work).

The only way around this is to break the arrays up into smaller bits.
They'll be more likely to find a home in your memory...what you can do
is break things up into smaller arrays when manipulating them and then
put them back together later.

I'm not sure I'm expressing this as well as I might, but I'm willing
to rephrase things if I'm not making myself clear.

Joel
--
Joel D Offenberg | "Aren't you in the position of a life-long
Hughes STX/ UIT Science Team | vegetarian giving us your recipe for steak
offenbrg@fondue.gsfc.nasa.gov | and kidney pie?" - Rumpole of the Bailey
I get paid to stare into space. |
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Image w/contours in PostScript?
Next Topic: VMS input file line counting procedure

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

Current Time: Fri Oct 10 14:02:36 PDT 2025

Total time taken to generate the page: 0.80022 seconds