Skip to content

Commit 937a90a

Browse files
Create mem_profile.py
1 parent 5d14af3 commit 937a90a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: mem_profile.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import psutil
2+
import os
3+
import sys
4+
import time
5+
6+
7+
def memory_usage_psutil():
8+
process = psutil.Process(os.getpid())
9+
mem = process.memory_info().rss / float(2 ** 20)
10+
return '{:.2f} MB'.format(mem)

0 commit comments

Comments
 (0)