如何可以得知,运行的某个时候,产生的目标字典占用了多少内存?
如何才可以得知,
运行的某个时候,
产生的目标字典,
占用了多少内存。
看看这样是不是好多了 ?
?
@si 我第一认知也是这个,只是这个似乎是不准确。。。
@iamwho 这个似乎是不准确的。。。
看了一晚网上关于这方面的各种说法,问的这个问题,似乎在 Python 上无解。。。
不过不重要了,打算把磁盘上 53MB 的内容放入字典传来传去了
Return the size of an object in bytes. The object can be any type of object. All built-in objects will return correct results, but this does not have to hold true for third-party extensions as it is implementation specific.
Only the memory consumption directly attributed to the object is accounted for, not the memory consumption of objects it refers to.
https://docs.python.org/3/library/sys.html#sys.getsizeof