Sorry this may be quite basic but just wanted to confirm it:
Let's say that I have a proc which generates a large dict and returns
it. Then when used, the caller assigns it to a variable.
How much memory is used, 10mb or 20mb? (let's ignore any extra memory
needed to manage the dict structure and the proc calls).
proc generate_10mb_dict {a b c} {
# generate a large dict, in d
return $d
}
set my_data [generate_10mb_dict $a $b $c]
what is the ram use at this point?
On 8/8/2024 4:27 PM, Rich wrote:
Given your sample code, the usage is the amount taken up by the dict.
If the dict is 10mb (as you suggest) then after "set my_data" the ram
usage is 10mb.
Thank you!
d and a are reference counted.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 493 |
Nodes: | 16 (2 / 14) |
Uptime: | 172:23:52 |
Calls: | 9,704 |
Calls today: | 4 |
Files: | 13,736 |
Messages: | 6,178,515 |