O
ochronus
Hi All,
I have a script which serves as a cache, storing "large" (around
60MB) objects. Once in a day I have to drop
the old data and load fresh data in the cache. The cache itself is
simply a hash of hashes, nothing special. I thought of a simple
process: I wrote a loader method,
def loader
tmp_holder = get_new_data(somehow)
$actual_cache = tmp_holder
end
I expected tmp_holder to be freed after the method finishes, since
it's not referred to anywhere else. What's actually
happening is that my script is using more and more memory as days
pass, as if tmp_holder was still present.
How could I solve this situation?
Thank you in advance,
Ochronus
I have a script which serves as a cache, storing "large" (around
60MB) objects. Once in a day I have to drop
the old data and load fresh data in the cache. The cache itself is
simply a hash of hashes, nothing special. I thought of a simple
process: I wrote a loader method,
def loader
tmp_holder = get_new_data(somehow)
$actual_cache = tmp_holder
end
I expected tmp_holder to be freed after the method finishes, since
it's not referred to anywhere else. What's actually
happening is that my script is using more and more memory as days
pass, as if tmp_holder was still present.
How could I solve this situation?
Thank you in advance,
Ochronus