equal
deleted
inserted
replaced
13 |
13 |
14 |
14 |
15 def memusage(ui): |
15 def memusage(ui): |
16 """Report memory usage of the current process.""" |
16 """Report memory usage of the current process.""" |
17 result = {'peak': 0, 'rss': 0} |
17 result = {'peak': 0, 'rss': 0} |
18 with open('/proc/self/status', 'r') as status: |
18 with open('/proc/self/status') as status: |
19 # This will only work on systems with a /proc file system |
19 # This will only work on systems with a /proc file system |
20 # (like Linux). |
20 # (like Linux). |
21 for line in status: |
21 for line in status: |
22 parts = line.split() |
22 parts = line.split() |
23 key = parts[0][2:-1].lower() |
23 key = parts[0][2:-1].lower() |