[New-bugs-announce] [issue24172] Errors in resource.getpagesize module documentation

Mahmoud Hashemi report at bugs.python.org
Wed May 13 08:21:32 CEST 2015

New submission from Mahmoud Hashemi:

The resource module's description of resource.getpagesize is woefully misguiding. Reproduced in full for convenience:


    Returns the number of bytes in a system page. (This need not be the same as the hardware page size.) This function is useful for determining the number of bytes of memory a process is using. The third element of the tuple returned by getrusage() describes memory usage in pages; multiplying by page size produces number of bytes.

Besides being vague by not referring to the third element as ru_maxrss, the peak RSS for the process (i.e., not the current memory usage), tests on Linux, Darwin, and FreeBSD show the following:

  * Linux: ru_maxrss is in kilobytes
  * Darwin (OS X): ru_maxrss is in bytes
  * FreeBSD: ru_maxrss is in kilobytes (same as Linux)

Knowing the page size is probably useful to someone, but the misinformation has definitely sent more than one person down the wrong path here. Additionally, the correct information should be up in the getrusage() method documentation, closer to relevant field descriptions.


assignee: docs at python
components: Documentation
messages: 243043
nosy: docs at python, mahmoud
priority: normal
severity: normal
status: open
title: Errors in resource.getpagesize module documentation
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list