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

Home » Public Forums » archive » memory allocation for structure arrays
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: memory allocation [message #16451 is a reply to message #11586] Mon, 26 July 1999 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Essa Yacoub (yacoub@cmrr.umn.edu) writes:

> I am assigning an array using the complex function
>
> rd=
> complex(mag_regress*cos(phase_regress),mag_regress*sin(phase _regress))
>
>>> 99% of the time this turns out to be a programming error >>>
>
> the code works, because I have successfully used it on several data
> sets of
> different sizes. In this particular case, the data size is much
> larger. I am running
> this on an sgi onyx 2 system with 2 gig of ram, so that should not
> be
> a problem. In fact I can open another session in another window and
> create bigger arrays with no problem. It actually crashed before
> this above statement
> and I zeroed an array I was no longer using and it continued a while
> longer.
> (using .con) before crashing again at a different line.

I'm going to guess that there are more of these large arrays
hanging around that you are also not cleaning up. When you
are finished with an array, you want to clear the memory that
is associated with it. This can be done by setting the array
to the value 0. Or it can be done more elegantly with my
UNDEFINE routine that you can find on my web page.

You also want to use the TEMPORARY function if you find
the same large array on both sides of the equal sign. That
is, instead of this:

array = array * 10

use this:

array = TEMPORARY(array) * 10

You might also try modularizing your code more. Many times
this problem comes about because people write huge main-level
programs instead of smaller procedures and functions.

> It is definitely a size problem but I don't understand
> why, or how I can clear up memory, or access more system memory....

To get more system memory allocated to your IDL process, it
helps to sacrifice your first-born child to the system administration
gods. But even if you do it when they are quite young and
innocent, it seldom helps. :-(

Cheers,

David

P.S. If your first-born is a teenager, forget it. The gods turn
those older sacrifices into administrators in charge of
program budgets. :-(

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: password-entry widget
Next Topic: Re: idlwave mode for emacs/xemacs?

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

Current Time: Sun Oct 12 00:50:44 PDT 2025

Total time taken to generate the page: 2.64681 seconds