Does tcl free up memory of existing dict variable when new blank dict is assigned?
<p>My tcl application uses dictionary to store large databases and has to ensure memory does not blow up significantly. I am looking for a simple approach to free up memory of entire dictionary.</p>

<p>In the below code sequence, I am reassigning a blank dict to a variable which already has a large size dict associated with it. I can see that the contents of the new dict with the variable are empty but will it also free up the memory? in other words, is this equivalent to executing unset statement for key-value pairs?</p>

<pre><code>set db [dict create]
dict set db key1 value1
dict set db key2 value2

# Will this next step recover memory of all previous key-value assignments?
set db [dict create]
</code></pre>