简体   繁体   中英

How to find memory usage of Kaggle notebook?

I want to know how to find the memory usage of a Kaggle notebook. How can I find that how much RAM has been used while running a Kaggle notebook. Kaggle is a site which allows python jupyter notebooks to run on it.

Use this code to track your memory usage of the notebook:

import os, psutil  

def cpu_stats():
    pid = os.getpid()
    py = psutil.Process(pid)
    memory_use = py.memory_info()[0] / 2. ** 30
    return 'memory GB:' + str(np.round(memory_use, 2))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM