Re: How do I free memory? [message #2461] |
Wed, 13 July 1994 09:24 |
caron
Messages: 16 Registered: May 1994
|
Junior Member |
|
|
In article <3009vu$1q3@hermod.uio.no>, steinhh@amon.uio.no (Stein Vidar Hagfors Haugan) writes:
|>
|> In article <GEOMAGIC.94Jul12152036@moe.seismo.do.usbr.gov>, geomagic@seismo.do.usbr.gov (Dan O-Connell) writes:
|> |> In article <1994Jul12.152415.23858@noao.edu> eharold@corona.sunspot.noao.edu (Elliotte Harold) writes:
|> |> [..]
|> |> > When I free an array how do I get IDL to give up the memory it
|> |> > grabbed to get the array in the first place? I think IDL can reuse
|> |> > the 39 megabytes if it needs it but I'd like to make that memory available
|> |> > to any other process running on my machine, not just IDL.
|> |>
|> |> Delvar deletes variables and deallocates their memory.
|> |>
|>
|> But this doesn't really give the memory back to the operating system.
|> The problem is in unix, and has nothing to do with IDL. Any other program
|> using large memory chunks has the same problem.
|>
|> So, no cure is available (under UNIX, that is)
Remember you are on a virtual memory machine. Whats important to performance
is the amount of physical memory you need to satisfy memory requests. Its true
that when you "free" memory you dont decrease the virtual adrress space, but
(assuming you have enough swap space) that doesnt effect performance really.
Its a good idea to free unneeded memory, so that your programs virtual space
stays as compact as possible.
See July 1994 Unix Review "Understanding SVR4 Memory Allocation" for gory
details.
|
|
|
Re: How do I free memory? [message #2463 is a reply to message #2461] |
Wed, 13 July 1994 08:28  |
n9140397
Messages: 13 Registered: July 1994
|
Junior Member |
|
|
In article <GEOMAGIC.94Jul12152036@moe.seismo.do.usbr.gov> geomagic@seismo.do.usbr.gov (Dan O-Connell) writes:
> In article <1994Jul12.152415.23858@noao.edu> eharold@corona.sunspot.noao.edu (Elliotte Harold) writes:
>>
>> 4. a=0
>> 5. topx still says IDL is using 39 megabytes.
>>
>> When I free an array how do I get IDL to give up the memory it
>> grabbed to get the array in the first place? I think IDL can reuse
>> the 39 megabytes if it needs it but I'd like to make that memory available
>> to any other process running on my machine, not just IDL.
>
> Delvar deletes variables and deallocates their memory.
Yeah, but, remember that calling delvar *also* erases the main
program you have running. Just a quirk I ran into playing around
with it a couple of days ago myself.
This may or may not be a problem. In any case, putting delvar
in a program seems to be a pretty bad idea, as the program erases
itself...
Or, is there a way around that? Anybody?
Mike H.
UCSD SIO
|
|
|
Re: How do I free memory? [message #2470 is a reply to message #2463] |
Wed, 13 July 1994 01:52  |
steinhh
Messages: 260 Registered: June 1994
|
Senior Member |
|
|
In article <GEOMAGIC.94Jul12152036@moe.seismo.do.usbr.gov>, geomagic@seismo.do.usbr.gov (Dan O-Connell) writes:
|> In article <1994Jul12.152415.23858@noao.edu> eharold@corona.sunspot.noao.edu (Elliotte Harold) writes:
|> [..]
|> > When I free an array how do I get IDL to give up the memory it
|> > grabbed to get the array in the first place? I think IDL can reuse
|> > the 39 megabytes if it needs it but I'd like to make that memory available
|> > to any other process running on my machine, not just IDL.
|>
|> Delvar deletes variables and deallocates their memory.
|>
But this doesn't really give the memory back to the operating system.
The problem is in unix, and has nothing to do with IDL. Any other program
using large memory chunks has the same problem.
So, no cure is available (under UNIX, that is).
Stein Vidar Haugan
|
|
|
Re: How do I free memory? [message #2472 is a reply to message #2470] |
Tue, 12 July 1994 15:20  |
geomagic
Messages: 22 Registered: November 1993
|
Junior Member |
|
|
In article <1994Jul12.152415.23858@noao.edu> eharold@corona.sunspot.noao.edu (Elliotte Harold) writes:
> Here's the problem in brief.
>
> 1. Start IDl
> 2. a=intarr(320,256,200)
> 3. In another window the Solaris program topx tells me that IDL
> is using about 39 megabytes, approximately correct for the array.
3.b delvar,a
> 4. a=0
> 5. topx still says IDL is using 39 megabytes.
>
> When I free an array how do I get IDL to give up the memory it
> grabbed to get the array in the first place? I think IDL can reuse
> the 39 megabytes if it needs it but I'd like to make that memory available
> to any other process running on my machine, not just IDL.
Delvar deletes variables and deallocates their memory.
Dan O'Connell
geomagic@seismo.do.usbr.gov
Seismotectonics Group, U.S. Bureau of Reclamation
Denver Federal Center, P.O. Box 25007 D-3611, Denver, CO 80225
"We do custom earthquakes (for food)"
or
"Just more roadkill on the information superhighway"
/\
/ \
/ \ /\ /\
/\ / \ / \ / \ /\ /\/\ /\/\
___/ \ /\/\/\/ \ / \ /\ / \ / \/ \/ \ /\_______
\/ \ / \ / \/ \/ \/
\/ \/
--
Dan O'Connell
geomagic@seismo.do.usbr.gov
Seismotectonics Group, U.S. Bureau of Reclamation
|
|
|