The following:
proc leakMemory {} {
for {set i 0} {$i < 500000} {incr i} {
append values $i
}
nsv_array reset myNsv $values
}
Leaks about 1 megabyte of memory per execution. The memory leak appears to
come from nsv_array reset.
We're maintaining a very large data structure in an nsv, which occasionally
needs to be updated. Resetting is obviously the only thread safe way of
doing this, but the operation leaks 20-30 megs of memory a pop. (Unsetting
the entries manually does not leak memory, but is not thread safe.)
Has anyone seen this one before? After looking over the source, the cause
not obvious. (I assume that casting a char** to a char* and freeing it with
ckfree is a standard practice, as I see it all over the codebase, but I
couldn't track down ckfree's implementation.)
Any ideas?
Thanks,
Sean