GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — code_snippets/mem_profile_old.py at master · bashimoha/code_snippets Expand file tree/ Copy pathmem_profile_old.pyMore file actions 19 lines (17 loc) · 562 Bytes / Copy pathmem_profile_old.pyFile metadata and controls19 lines (17 loc) · 562 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 from pympler import summary, muppy import psutil import resource import os import sys def memory_usage_psutil(): # return the memory usage in MB process = psutil.Process(os.getpid()) mem = process.get_memory_info()[0] / float(2 ** 20) return mem def memory_usage_resource(): rusage_denom = 1024. if sys.platform == 'darwin': # ... it seems that in OSX the output is different units ... rusage_denom = rusage_denom * rusage_denom mem = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / rusage_denom return mem |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |