So, I have a dictionary which I want to flush out once a day
So.. something like
d = {}
def refresh():
global d
now = datetime.datetime.now()
if now >= TIME_TO_REFRESH:
d = {}
When I look into the memory profile, the memory grows as the size of d grows, but then when its time to refresh, I expect the memory to drop.
The issue is that it does.. but not to a great extent.
I am wondering if there is something else I need to do in order to make sure that the entire contents of the dictionary get flushed.
Maybe its already happening but I am not able to find a good resource to see how the garbage collector works in this instance?