The best way to keep data in RAM / object-oriented programming [message #68788] |
Thu, 03 December 2009 07:44 |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
Hi gurus,
My application needs a lot of RAM so I have to improve a solution in
order to to use less resources.
Normally, when I've an object I use declarations like this:
pro myobject__define
struct = { myobject, $
data: ptr_new() }
end
Now for example if my object has to save an array like FLTARR
(400,400,24,97) I will use the data pointer to store this array. The
problem is that if I do this I take a lot of computer resources. With
this example:
help, /mem
aa=fltarr(400,400,24,97)
myobject->SetProperty, DATA=aa
aa=0l
help, /mem
IDl returns:
heap memory used: 658906, max: 805215874, gets: 1195,
frees: 387
heap memory used: 1490578946, max: 1490579037, gets: 1207,
frees: 398
So, only for this example I'm using 1.4 Gb aprox. I tried to used
ASSOC procedure but I didn't succeed.... Some suggestions or comments
about how to reduce the memory ? There is a method to store compressed
data or something similar ?
Thanks in advance,
nata
|
|
|