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

Home » Public Forums » archive » Solve memory problems
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Solve memory problems [message #64715 is a reply to message #64623] Tue, 13 January 2009 07:03 Go to previous messageGo to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
> Well, running a routine once, some common tricks may help to enhance
> the available memory:
>
> - Use the temporary-function,
> - Put the variables, I don't need anymore, to zero,
> - Working as much as possible with interger or byte arrays,
> - etc.

if not already in use, using pointers can be of great help. You can save
each band in a different pointer, or even each line etc. Therefore, the
size of the required contiguous memory space decreases.

> However, specially when running an already optimized routine several
> times (e.g. for several scenes), available memory will disappear over
> short or long. I guess, this has to do with the growing fragmentation
> of the memory.

As Carsten has mentioned, play with memtest.pro (from ITTVIS) to find
out what is happening. It could as well be a memory leak (you create a
pointer but don't destroy it). In this case, make a call to "heap_gc"
after your function.

> A solution could be to use the same variables for different grids in a
> subroutine. However, I prefer to name the variables according to their
> physical (or whatever) meaning. Otherwise, after some time, I don't
> have any chance to understand my programms anymore.
>
> In my dreams, delvar is available also in routines. However, it's not,
> is it?
>
> So, after this long introduction: What strategies are you using, to
> have more memory available, or to prevent the fragmentation of the
> memory?

Under windows, try to assign an array as big as possible, 1st thing in
your program. At least you are "reserving" the contiguous memory for IDL.

Switching to Linux made my life soooooo much easier, for any
memory-related problem!

Jean

>
> Thanks for any comments.
>
> Regards,
> Corinne
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: question about array interpolation
Next Topic: Re: pdf extractor

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

Current Time: Thu Oct 09 21:50:06 PDT 2025

Total time taken to generate the page: 0.16108 seconds