Skip to content

Instantly share code, notes, and snippets.

View zpoint's full-sized avatar
🏍️
如果把一切都准备好了再前行,那我们永远迈不出第一步。

zpoint zpoint

🏍️
如果把一切都准备好了再前行,那我们永远迈不出第一步。
View GitHub Profile
@zpoint
zpoint / PyRefcount.md
Last active February 25, 2023 08:21
Lost connection to python doesn't means they will be deallocate

In Cpython

If you create some objects and lost connection to these object, it doesn't means the object will be deallocated

# python3.5
import psutil
import os
def memory_profile():
    print("The process consumes %.2f Megabytes\n" % 
    (psutil.Process(os.getpid()).memory_info().rss / float(1000 * 1000), ))