[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

HANDLE_FREE: when to use? is it necessary?




I was told once by RSI that if one is only about to reassign
a handle to point to a NEW piece of data (when it already 
points to some other data) it is *not* necessary to call
HANDLE_FREE.

Also, interestingly, using grep in idl's home /lib dir and in
several pub domain dirs which have hundreds of IDL source files
and applications, I can find only 3 or 4 occurrences of 'handle_free'
OR 'HANDLE_FREE'.  Why does it not get used?  Why does the manual
never say or show how to use it?  Is it really so unimportant?

I ask because my app is getting memory hungry, and its memory
consumption currently monotonically grows over the course
of an extended session of using it, even though when user
'opens' a new 'doc', I set all large arrays to scalar 0.

All compiling has been done before I start taking measurements.

The only possible source would seem to be the fact that I am
not explicitly freeing handles, I am simply pointing them to
new things.

If freeing handles is really the answer, and is a required practise,
then why so few occurrences of its use in IDL programs?

Anyone ever gotten a good FAQ on IDL memory management, beyond the
few pointers given in the User's Guide, and what can be gleaned
from the C programming info in the Advanced Dev. Guide??

Thanks much,
                                                    /
Russ Welti                                         /-\
                                                  (c-g)                     
University of Washington                           \-/                      
Molecular Biotechnology                             /                       
PO Box 357730                                      /-\                      
Seattle, WA  98195                                (a-t)                     
rwelti@u.washington.edu                            \-/                     
(206) 616 5116 voice   (206) 685 7301 FAX           /