Skip to content

Commit 992cefe

Browse files
committed
Linux: remove hugetlb mem metric. On 2nd though it's too niche.
1 parent 5b25504 commit 992cefe

7 files changed

Lines changed: 5 additions & 14 deletions

File tree

docs/api-overview.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ Memory
405405
rss_file=897433,
406406
rss_shmem=0,
407407
swap_anon=0,
408-
hugetlb=0)
408+
locked=0)
409409
>>>
410410
>>> p.memory_percent()
411411
0.78

docs/api.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1699,8 +1699,6 @@ Process class
16991699
+-------------+----------------+--------------------+
17001700
| swap_anon | | peak_nonpaged_pool |
17011701
+-------------+----------------+--------------------+
1702-
| hugetlb | | |
1703-
+-------------+----------------+--------------------+
17041702
| locked | | |
17051703
+-------------+----------------+--------------------+
17061704

@@ -1721,8 +1719,6 @@ Process class
17211719
:field:`swap` (it reads :proc:`/proc/pid/status` instead of smaps) but
17221720
does not count shmem swap (see :ref:`faq_memory_swap`). Set to 0 on Linux
17231721
< 2.6.34.
1724-
- :field:`hugetlb`: resident memory backed by huge pages. Set to 0 on Linux
1725-
< 4.4.
17261722
- :field:`locked`: locked memory that cannot be
17271723
:term:`swapped out <swap-out>`. Typically locked via :manpage:`mlock(2)`.
17281724

docs/changelog.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Changelog
5555
:meth:`Process.memory_footprint` returns a new :field:`shared` field:
5656
resident memory shared with other processes.
5757

58-
Reorganization of process memory APIs (:gh:`2731`, :gh:`2736`, :gh:`2723`,
59-
:gh:`2733`, :gh:`2988`).
58+
Reorganization of process memory APIs (:gh:`2731`, :gh:`2736`, :gh:`2733`,
59+
:gh:`2988`).
6060

6161
- New :meth:`Process.memory_extras` method, returning extra platform-specific
6262
memory metrics on Linux, macOS and Windows. See

docs/migration.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ New memory_extras() method
167167
platform-specific memory metrics which complement :meth:`Process.memory_info`:
168168

169169
- Linux: :field:`peak_rss`, :field:`peak_vms`, :field:`rss_anon`,
170-
:field:`rss_file`, :field:`rss_shmem`, :field:`swap_anon`, :field:`hugetlb`,
171-
:field:`locked`.
170+
:field:`rss_file`, :field:`rss_shmem`, :field:`swap_anon`, :field:`locked`.
172171
- macOS: :field:`phys_footprint`, :field:`peak_footprint`.
173172
- Windows: :field:`virtual`, :field:`peak_virtual`, :field:`paged_pool`,
174173
:field:`nonpaged_pool`, :field:`peak_paged_pool`,

psutil/_ntuples.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ class pmem_extras(NamedTuple):
419419
rss_file: int
420420
rss_shmem: int
421421
swap_anon: int
422-
hugetlb: int
423422
locked: int
424423

425424
# psutil.Process().memory_full_info()

psutil/_pslinux.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,12 +1914,11 @@ def memory_extras(
19141914
_rssfile_re=re.compile(br"RssFile:\s+(\d+)"),
19151915
_rssshmem_re=re.compile(br"RssShmem:\s+(\d+)"),
19161916
_vmswap_re=re.compile(br"VmSwap:\s+(\d+)"),
1917-
_hugetlb_re=re.compile(br"HugetlbPages:\s+(\d+)"),
19181917
_vmlck_re=re.compile(br"VmLck:\s+(\d+)"),
19191918
):
19201919
# Read /proc/{pid}/status.
19211920
# RssAnon/RssFile/RssShmem were added in Linux 4.5;
1922-
# VmSwap in 2.6.34; HugetlbPages in 4.4.
1921+
# VmSwap in 2.6.34.
19231922
data = self._read_status_file()
19241923

19251924
def parse(regex):
@@ -1933,7 +1932,6 @@ def parse(regex):
19331932
rss_file=parse(_rssfile_re),
19341933
rss_shmem=parse(_rssshmem_re),
19351934
swap_anon=parse(_vmswap_re),
1936-
hugetlb=parse(_hugetlb_re),
19371935
locked=parse(_vmlck_re),
19381936
)
19391937

tests/test_process.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,6 @@ def test_memory_extras_fields_order(self):
504504
"rss_file",
505505
"rss_shmem",
506506
"swap_anon",
507-
"hugetlb",
508507
"locked",
509508
)
510509
elif MACOS:

0 commit comments

Comments
 (0)