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

Home » Public Forums » archive » Garbage collection and Memory
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: Garbage collection and Memory [message #2290 is a reply to message #2105] Fri, 10 June 1994 07:44 Go to previous messageGo to previous message
eharold is currently offline  eharold
Messages: 12
Registered: July 1993
Junior Member
|> In article <thompson.770745164@serts.gsfc.nasa.gov>, thompson@serts.gsfc.nasa.gov (William Thompson) writes:
|> |> hevans@estwm0.wm.estec.esa.nl (Hugh Evans) writes:
|> |>
|> |> >I have discovered that after using Wave for an extended period that it slowly
|> |> >grabs more and more memory, even if new variables are not created, until
|> |> >finally it runs out of core memory. Whereas by saving the session and
|> |> >restarting it, the previous operation that crashed on a memory allocation
|> |> >problem will complete successfully.
|> |>

I think I've bumped across this one myself and although the problem
is documented, it's still nasty. Consider the following sequence

a=indgen(really_big_number)
a=findgen(some_other_number)

The allocation from the first statement isn't freed when the second
assignment to a is made, even though, near as I can tell, there's no way
to get at the values stored in a from the first assignment. On the other
hand the sequence of statements

a=indgen(really_big_number)
a=0
a=findgen(some_other_number)

will free the first allocation. Why does assignment to a scalar free the
memory allocated to a but assignment to an array just leaves it hanging?
I have no idea, but this is how IDL works and it's quite annoying. Since
after the a=findgen(some_other_number) there's no way to get at the
original contents of a I see no reason not to automatically free a before
making the assignment, but currently that's not what happens. Consequently
unless you're careful to manully free arrays by setting them to scalars
before reassigning them, you'll pile up a lot of allocated but unused
memory.

--

Elliotte Rusty Harold National Solar Observatory
eharold@sunspot.noao.edu Sunspot NM 88349
[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
Previous Topic: Mouse with Xmanager registers too fast
Next Topic: Re: image data extraction

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

Current Time: Tue Oct 14 17:37:18 PDT 2025

Total time taken to generate the page: 0.66530 seconds