Skip to content

Commit

Permalink
fix memory_info() of psutil
Browse files Browse the repository at this point in the history
  • Loading branch information
davies committed Jul 24, 2014
1 parent 67e6eba commit dcf03a9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions python/pyspark/shuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@

def get_used_memory():
""" Return the used memory in MB """
self = psutil.Process(os.getpid())
return self.memory_info().rss >> 20

process = psutil.Process(os.getpid())
if hasattr(process, "memory_info"):
info = process.memory_info()
else:
info = process.get_memory_info()
return info.rss >> 20
except ImportError:

def get_used_memory():
Expand Down

0 comments on commit dcf03a9

Please sign in to comment.