Re: HELP,/MEMORY --example [message #4976] |
Fri, 01 September 1995 00:00 |
Russ Welti
Messages: 27 Registered: October 1994
|
Junior Member |
|
|
Upon further thought I decided that the number of calls
to MALLOC and FREE would not be expected to be the same (!)
but I still have doubt that the figures can be very
useful. Here's why:
ENTER IDL>
heap memory in use: 73526, calls to MALLOC: 111, FREE: 15
IDL> a=intarr(1)
heap memory in use: 73671, calls to MALLOC: 114, FREE: 15
IDL> b=fltarr(300)
heap memory in use: 75014, calls to MALLOC: 117, FREE: 15
IDL> h=handle_create()
heap memory in use: 76053, calls to MALLOC: 120, FREE: 15
IDL> handle_value,h,a,/set
heap memory in use: 76208, calls to MALLOC: 123, FREE: 15
IDL> a="hello"
heap memory in use: 76197, calls to MALLOC: 126, FREE: 16
IDL> delvar,a
heap memory in use: 76229, calls to MALLOC: 129, FREE: 18
Creating any variable/handle involved 3 calls to malloc.
Reassigning an existing variable also had 3 calls to malloc,
and 1 call to free.
Deleting existing variable shows the same 3 calls to malloc,
and 2 calls to free.
I'm sure there's precise reasons why I see these figures, but
my contention is that a developer without insight into what
the expected patterns should be, cannot make use of these
statistics for very much...
Any thoughts?
Russ Welti rwelti@u.washington.edu
|
|
|