Skip to content

Commit

Permalink
Create mem_profile.py
Browse files Browse the repository at this point in the history
  • Loading branch information
CoreyMSchafer authored Jan 6, 2017
1 parent 5d14af3 commit 937a90a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mem_profile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import psutil
import os
import sys
import time


def memory_usage_psutil():
process = psutil.Process(os.getpid())
mem = process.memory_info().rss / float(2 ** 20)
return '{:.2f} MB'.format(mem)

0 comments on commit 937a90a

Please sign in to comment.