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

Home » Public Forums » archive » Re: freeing memory in programs
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: freeing memory in programs [message #3930 is a reply to message #3928] Fri, 24 March 1995 02:01 Go to previous message
Fergus Gallagher is currently offline  Fergus Gallagher
Messages: 41
Registered: January 1995
Member
> Subject: freeing memory in programs
> Date: 23 Mar 1995 15:03:55 -0000
> From: pjclinch@dux.dundee.ac.uk (Pete Clinch)
> Organization: The University, Dundee, DD1 4HN, Scotland, UK.
> Newsgroups: comp.lang.idl-pvwave
>
> I'm writing a Wave Widgets program that uses some big arrays (256 * 256 *
> 128 MRI image stacks). Some operations require temporary arrays to hold
> significant chunks of this, but I don't want these arrays around full
> time to choke the memory. I can't use DLEVAR as I'm not at the main
> program level, so how do I free up memory? If I had assigned an array
> by, say
>
> TmpArr = MAKE_ARRAY(256,256,128, /INT)
>
> would a subsequent use of something like TmpArr = BYTE(0) or
> TmpArr = MAKE_ARRAY(1) free up the memory, or would it still be taken up
> but no longer accessible?



There is the help,/mem command to help you with this. I *suspect* that it
depends on the other memory that's been allocated in the meantime. The
memory is almost certainly available but, generally, in a non-contiguous
block wrt other memory on the heap.

Strangely,

IDL> tmp = intarr(1000,1000) ; say
IDL> print,temporary(tmp)

Help,/mem shows that memory has still been 'lost' in this case.

Note that here I have used an alternative way of 'deallocating' a variable.
(I seem to remember reading somewhere that it is preferable to tmp=0)

Fergus

=================================================
| Fergus Gallagher |
| Remote Sensing Applications Development Unit |
| British National Space Centre |
| Monks Wood |
| Huntingdon PE17 2LS / UK |
| |
| F.Gallagher@nerc.ac.uk |
| http://uh.nmt.ac.uk/bnsc/fgg.html |
=================================================
[Message index]
 
Read Message
Read Message
Previous Topic: IDL widgets: comments and questions
Next Topic: Best way to prevent deformed IDL widgets?

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

Current Time: Sat Oct 11 16:16:25 PDT 2025

Total time taken to generate the page: 7.35968 seconds