Skip to content

Conversation

@lcheylus
Copy link
Contributor

  • Add BSD bool variable (= true if running on BSD OS)
  • Use psutil to get memory infos on BSD
  • Use psutil.memory_info().rss on BSD instead of memory_full_info().uss (not supported)

Fix #219


Tests OK on OpenBSD current/amd64 with Python 3.12.11

$ pytest
============================= test session starts =============================
platform openbsd7 -- Python 3.12.11, pytest-8.4.2, pluggy-1.6.0
rootdir: /home/fox/dev/pyperf.git
configfile: pyproject.toml
collected 173 items

pyperf/tests/test_bench.py ...................................          [ 20%]
pyperf/tests/test_cli.py ..                                             [ 21%]
pyperf/tests/test_examples.py ........                                  [ 26%]
pyperf/tests/test_metadata.py .....                                     [ 28%]
pyperf/tests/test_misc.py .........                                     [ 34%]
pyperf/tests/test_perf_cli.py ...................................       [ 54%]
pyperf/tests/test_runner.py .............................               [ 71%]
pyperf/tests/test_system.py .                                           [ 71%]
pyperf/tests/test_timeit.py ...............................             [ 89%]
pyperf/tests/test_utils.py ..................                           [100%]

============================ 173 passed in 47.13s =============================

- Add BSD bool variable (= true if running on BSD OS)
- Use psutil to get memory infos on BSD
- Use psutil.memory_info().rss on BSD instead of memory_full_info().uss
  (not supported)

Signed-off-by: Laurent Cheylus <foxy@free.fr>
Signed-off-by: Laurent Cheylus <foxy@free.fr>
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vstinner vstinner merged commit d2cc803 into psf:main Oct 30, 2025
12 checks passed
@vstinner
Copy link
Member

Merged, thanks for your contribution!

@lcheylus lcheylus deleted the bsd-track_memory branch October 31, 2025 09:07
@lcheylus
Copy link
Contributor Author

Merci pour le merge. On pourra se croiser ce week-end à la PyConFr à Lyon, où je serai présent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Errors with track-memory on OpenBSD

2 participants