Created
February 22, 2015 16:40
-
-
Save juancarlospaco/1d85d7590217f47a318f to your computer and use it in GitHub Desktop.
RAM Memory used by itlsef
This file contains hidden or 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
# resource is Linux/OsX only | |
import sys | |
import resource | |
# Gives result on Integer, MegaBytes on Linux/OsX, or 0 on Windows since info is not available. | |
int(resource.getrusage(resource.RUSAGE_SELF).ru_maxrss * resource.getpagesize() / 1024 / 1024 | |
if not sys.platform.startswith("win") else 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment