memory consumption

Alexey zen.supagood at gmail.com
Wed Mar 31 04:12:48 EDT 2021


вторник, 30 марта 2021 г. в 18:43:51 UTC+3, Marco Ippolito:
> Have you tried to identify where in your code the surprising memory allocations 
> are made? 
Yes. 
> You could "bisect search" by adding breakpoints: 
> 
> https://docs.python.org/3/library/functions.html#breakpoint 
> 
> At which point does the problem start manifesting itself?
The problem spot is my cache(dict). I simplified my code to just load 
all the objects to this dict and then clear it. After loading "top" 
was showing resident memory usage at 3.3Gb and immediately after that I
did self.__cache.clear() and memory reduced to 1Gb. Then I tried to find 
any references to this dict with no luck. Also I tried "del self.__cache". 
For debugging I use Pycharm


More information about the Python-list mailing list