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

Home » Public Forums » archive » IDL memory usage
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
IDL memory usage [message #9080] Wed, 28 May 1997 00:00 Go to next message
Gary Fu is currently offline  Gary Fu
Messages: 9
Registered: April 1997
Junior Member
Hi,

I monitored the memory usage on the following two IDL cases.
In case 1, the IDL process takes 31MB of memory (8MB of IDL
reserved + 24MB of data, reasonable). However, in case 2,
it takes 47MB of memory. Anyone knows why and is there a way
to fix the problem ?

Thanks.

Gary

**********************************************************

Case 1:
a = indgen(2000,4000)
a = a(*,0:1999)

Case 2:

a = indgen(2000,4000)
ia = indgen(2000) * 2
b = a(*,ia) ; OR b = TEMPORARY(a(*,ia))

**********************************************************


--

*****************************************
* Gary Fu, GSC (301) 286-7107 *
* email : "gfu@seadas.gsfc.nasa.gov" *
* NASA/Goddard Space Flight Center *
*****************************************
Re: IDL memory usage [message #37632 is a reply to message #9080] Wed, 14 January 2004 07:07 Go to previous message
R.G. Stockwell is currently offline  R.G. Stockwell
Messages: 363
Registered: July 1999
Senior Member
"Michael Wallace" <mwallace.removethismunge@swri.edu.invalid> wrote in message news:bu1m97$7jd$1@nntp1.jpl.nasa.gov...
...
> I have a process which uses a fairly constant amount of
> memory (in IDL), but IDL keeps claiming more and more memory from the OS
> as time goes on. ...

IMHO the preferred solution would be to find the
programming error that is causing the memory leak.
I run IDL for weeks and weeks with no problem.
Check your heap, do you have pointers or objects
that are not being cleaned up?


Cheers,
bob
Re: IDL memory usage [message #37638 is a reply to message #9080] Tue, 13 January 2004 17:04 Go to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> However, this may not have the desired behavior. Once the program
> reaches the limit, any further memory allocations will fail and may
> wreak havoc on your program. It won't just run "slower."

In this particular case, I don't believe anything will be creating
havoc. I did a little test. First, I ran IDL without much else going
on. Eventually, it filled up most of the available memory. Once
finished, I opened up a bunch of other programs which chewed up a good
chunk of memory. I then ran my same IDL program again. It again filled
up most of the available memory, but it had nowhere near the amount that
it had the first time around (since other programs had already claimed
some of that) and it still executed in about the same time. So, this
led me to conclude that I might be able to safely limit the IDL process
and not run into any problems. Also, I was periodically printing out
the IDL memory usage from within IDL and it leveled off early on and
never grew over the rest of the execution even though you could watch
more and more memory being taken from the OS during this same time.

I will try limit/ulimit and see what happens. Thanks.

Mike
Re: IDL memory usage [message #37640 is a reply to message #9080] Tue, 13 January 2004 15:24 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Michael Wallace <mwallace.removethismunge@swri.edu.invalid> writes:
> Is there any way to set a maximum limit on the amount of memory an IDL
> process will use even if the machine running the code has more memory
> available? I have a process which uses a fairly constant amount of
> memory (in IDL), but IDL keeps claiming more and more memory from the OS
> as time goes on. I'd just like to cap the amount of memory IDL can get
> its grubby little hands on even if it means that my code will execute a
> little slower.

If you are running on Unix, you can limit the memory consumption by
using the limit or ulimit commands, depending on the shell you are
using. You would run one of these commands in the shell before
running IDL.

However, this may not have the desired behavior. Once the program
reaches the limit, any further memory allocations will fail and may
wreak havoc on your program. It won't just run "slower."

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Group leader question
Next Topic: Re: Group leader question

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

Current Time: Sun Oct 12 11:15:28 PDT 2025

Total time taken to generate the page: 1.12168 seconds