array operations and memory consumption [message #57945] |
Fri, 04 January 2008 14:19 |
dktr.ted
Messages: 17 Registered: November 2006
|
Junior Member |
|
|
Hi all,
Apologies in advance if this is old hat ... I've got a question
regarding IDL's memory usage that can be boiled down in the following
example:
IDL> a = BINDGEN(100,100,100)
IDL> baseMem = (MEMORY())[0]
IDL> a = a + 1
IDL> PRINT, (MEMORY())[3] - baseMem
2000049
I've tried modifying "a = a + 1" with various combinations of pointers
and the TEMPORARY function, but can't reduce this temporary elevated
memory consumption. Compare the above with a call to CONGRID:
IDL> a = BINDGEN(100,100,100)
IDL> baseMem = (MEMORY())[0]
IDL> a = CONGRID(a, 100, 100, 100)
IDL> PRINT, (MEMORY())[3] - baseMem
1003941
I'm working with some very large image arrays and trying to do some
"in place" manipulations. While I can slink by with the temporary
memory usage of the latter CONGRID-type operations, addition (or
multiplication) of an array by a scalar breaks the bank.
Any tips or directions to a helpful tutorial on IDL's memory policies
would be greatly appreciated. Thanks!
-Ted
P.S. IDL 7.0 on a 3 GHz Pentium w/ 2 GB RAM running Windows XP Pro
SP2, if it helps.
|
|
|