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

Home » Public Forums » archive » Strange memory problem
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: Strange memory problem [message #18423 is a reply to message #18337] Wed, 22 December 1999 00:00 Go to previous messageGo to previous message
Alex Schuster is currently offline  Alex Schuster
Messages: 124
Registered: February 1997
Senior Member
"R. Kyle Justice" wrote:

> When I do the following:
>
> temp=bytarr(1000,1000,25)
> temp(*)=10
>
> my computer (a Sparc20 with 128MB of *available* ram) grinds
> to a halt. Actually it starts using swap. Don't tell me
> PV-Wave is making 5 or 6 copies of the array just to do this
> simple process!
>
> Has anyone else seen this curious behavior on PV-Wave? IDL? I have
> verified it on a PC, and using different versions of PV-Wave(6.1,7.0).

Yes, I encountered the same problem. It seems that, when using the (*)
notation, IDL (and probably also PV-WAVE) replaces the * by an
appropiate index list, like here:

temp = bytarr(1000,1000,25)
index = lindgen(25000000L)
temp(index) = 10B

This index list takes 100 MB of memory! You can check this by the
command HELP, /MEMORY.

As others have pointed out, it is much faster when you use something
like this:
temp = bytarr(1000,1000,25)+10B
(Don't forget the B, because you would get an INTARR instead.)

This is much faster, and you need only 25 MB of RAM, as one would
expect.

Alex
--
Alex Schuster Wonko@weird.cologne.de PGP Key available
alex@pet.mpin-koeln.mpg.de
[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
Previous Topic: how to find the TLB of a widget
Next Topic: Tip: how to mix object gui with command line

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

Current Time: Wed Oct 08 19:11:16 PDT 2025

Total time taken to generate the page: 0.00529 seconds