📜  jupyter 消耗 100 个磁盘 - Python 代码示例

📅  最后修改于: 2022-03-11 14:47:19.957000             🧑  作者: Mango

代码示例1
#delete the data
a, b, c = pd.DataFrame(), pd.DataFrame(), pd.DataFrame()
lst = [a, b, c]
del a, b, c # dfs still in list
del lst     # memory release now

#Track CPU and RAM usage
import psutil # gives a single float value
psutil.cpu_percent() # gives an object with many fields
psutil.virtual_memory()
dict(psutil.virtual_memory()._asdict()) # you can convert that object to a dictionary