Skip to content

Commit

Permalink
Avoid segfault for processes that use hundreds of GBs of memory (#2497)
Browse files Browse the repository at this point in the history
  • Loading branch information
wdh authored Jan 12, 2025
1 parent ed1d425 commit d4b37d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -840,3 +840,7 @@ N: Aleksey Lobanov
C: Russia
E: [email protected]
W: https://github.com/AlekseyLobanov

N: Will Hawes
W: https://github.com/wdh
I: 2496
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ XXXX-XX-XX
deprecated in psutil 4.0.0, released 8 years ago. Substitute is
``Process.memory_full_info()``.

**Bug fixes**

- 2496_, [Linux]: Avoid segfault (a cPython bug) on ``Process.memory_maps()``
for processes that use hundreds of GBs of memory.

**Compatibility notes**

- 2480_: Python 2.7 is no longer supported.
Expand Down
2 changes: 1 addition & 1 deletion psutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ def memory_maps(self, grouped=True):
path = tupl[2]
nums = tupl[3:]
try:
d[path] = map(lambda x, y: x + y, d[path], nums)
d[path] = list(map(lambda x, y: x + y, d[path], nums))
except KeyError:
d[path] = nums
nt = _psplatform.pmmap_grouped
Expand Down

0 comments on commit d4b37d9

Please sign in to comment.