Created
January 1, 2021 09:39
-
-
Save timotewb/2358525fec9465f4b0145294c7a21327 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def clearRAM(print_usage=False): | |
import os | |
from hurry.filesize import size | |
import psutil | |
import gc | |
#--- clear ram | |
gc.collect() | |
#--- print usage | |
if print_usage == True: | |
process = psutil.Process(os.getpid()) | |
print(size(process.memory_info().rss)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment