Re: problem with builtin restore [message #60137] |
Mon, 28 April 2008 08:52 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Reimar Bauer <R.Bauer@fz-juelich.de> writes:
> Reimar Bauer schrieb:
>> Hi
>> we found a bug in restore of idl6.4 today. (linux version)
>> if you restore lots of files with always the same vars stored we
>> would
>> suppose that the memory allocation is always only done from the last
>> restore you did.
>> It looks like that you can overwrite the vars without reallocating
>> the
>> memory.
>> The cmrestore by CraigMarkwardt does it right.
>> cheers
>> Reimar Bauer
>
> hmm I'm currently not sure if craigs routine does allocate different.
Reimar, CMSAVE/CMRESTORE just use standard IDL variables, so the
allocation should be the same as IDL's standard
allocation/deallocation. This is not quite true if you use pointers
within your saved data, but this does not apply to your example.
Craig
|
|
|
Re: problem with builtin restore [message #60145 is a reply to message #60137] |
Mon, 28 April 2008 02:28  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Reimar Bauer schrieb:
> Hi
>
> we found a bug in restore of idl6.4 today. (linux version)
>
> if you restore lots of files with always the same vars stored we would
> suppose that the memory allocation is always only done from the last
> restore you did.
>
> It looks like that you can overwrite the vars without reallocating the
> memory.
>
> The cmrestore by CraigMarkwardt does it right.
>
> cheers
> Reimar Bauer
hmm I'm currently not sure if craigs routine does allocate different.
IDL> data1=make_array(100,306,21)
IDL> data2=make_array(100,306,21)
IDL> data3=make_array(100,306,21)
IDL> data4=make_array(100,306,21)
IDL> save,file='test.sav',data1,data2,data3,data4
IDL> save,file='test1.sav',data1,data2,data3,data4
IDL> save,file='test2.sav',data1,data2,data3,data4
IDL> .reset
IDL> help,/mem & restore,file='test.sav' & help,/mem
heap memory used: 827805, max: 11109933, gets: 2506, frees:
~ 1953
heap memory used: 11109981, max: 11114318, gets: 2511, frees:
~ 1954
IDL> help,/mem & restore,file='test.sav' & help,/mem
heap memory used: 11110070, max: 11110215, gets: 2519, frees:
~ 1961
heap memory used: 11110070, max: 13684951, gets: 2524, frees:
~ 1966
and change the input filename if you think there is no change in memory
by repeating the command
It happens on 7.0.1 too.
cheers
Reimar
|
|
|