Re: Fragmented memory with IDL [message #1045 is a reply to message #1044] |
Tue, 18 May 1993 18:58  |
deutsch
Messages: 19 Registered: February 1992
|
Junior Member |
|
|
In article <1tbs6sINN6eh@rave.larc.nasa.gov>, mayor@vaxine.larc.nasa.gov writes:
> IDLers,
>
>> We've noticed that occasionally we get the following error message:
>>
>> % Unable to allocate memory: to make array.
>> not enough core
>>
>> The interesting part is that it never occurs when we run the program
>> immediately after starting IDL. It does happen after running the
>> program multiple times EVEN with a RETALL at the end of each run.
>> Somehow, it appears that consecutive runs cause it to reserve
>> more and more memory - even though each run shouldn't require any
>> more than the previous runs in the same IDL session. Is there a
>> command that I can use to assure that all memory is cleared out
>> even after a retall?
>
> Alan Youngblood of RSI replies:
>
> The circumstances you describe happen when memory becomes fragmented.
> Unfortunately, there is nothing you can do except use less memory in
> your application, or get more for the system to work with.
>
This is, in a nutshell, correct. I believe that it is a problem of IDL
reserving memory from the OS (in this case VMS, I assume) in lots of little
chucks and at no point can any sort of garbage collection of memory
compaction really occur. In short, after allocating and freeing memory for
lots of arrays (especially large ones) the memory becomes "fragmented" such
that there is no contiguous memory chunk availble. Besides doing what Alan
suggests (look into the temporary() function if you're not using it) you
might try:
IDL> tmp=intarr(2048,3000,/nozero)
IDL> delvar,tmp
right after entering IDL. Change the 2048 and 3000 dimension sizes to be
about as big as your page file quota will allow. In theory, this gives IDL
one huge chunk of memory to work with and should allow it to manage variables
better than if it got them in little chunks. Note that if you have a huge
page file quota, you may only want to reserve roughly the amount of memory
you'll be using.
No guarantees that this will solve or help your problems, but do try it; it may.
Eric
Eric Deutsch
University of Washington
Department of Astronomy FM-20
Seattle, WA 98195
deutsch@astro.washington.edu or UWSPAN::JANUS::DEUTSCH
>
>
> ============================================================ ====================
> Shane D. Mayor, Lidar Applications Group, NASA Langley Research Center,
> Mail Stop 401A, Hampton, Virginia 23681-0001
> Internet: MAYOR@VAXINE.LARC.NASA.GOV Phone: 804-864-7598 Fax: 804-864-7790
> ============================================================ ====================
|
|
|