Skip to content

gh-150114: Log the memory usage in regrtest on macOS#150396

Merged
corona10 merged 5 commits into
python:mainfrom
corona10:gh-150114-macos
May 25, 2026
Merged

gh-150114: Log the memory usage in regrtest on macOS#150396
corona10 merged 5 commits into
python:mainfrom
corona10:gh-150114-macos

Conversation

@corona10
Copy link
Copy Markdown
Member

@corona10 corona10 commented May 25, 2026

@corona10
Copy link
Copy Markdown
Member Author

cc @vstinner

@corona10
Copy link
Copy Markdown
Member Author

!buildbot macOS

@bedevere-bot
Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @corona10 for commit 7327561 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F150396%2Fmerge

The command will test the builders whose names match following regular expression: macOS

The builders matched are:

  • x86-64 MacOS Intel NoGIL PR
  • x86-64 MacOS Intel ASAN NoGIL PR
  • x86-64 macOS PR
  • ARM64 MacOS M1 Refleaks NoGIL PR
  • ARM64 MacOS M1 NoGIL PR
  • ARM64 macOS PR

@corona10
Copy link
Copy Markdown
Member Author

!buildbot macOS

@bedevere-bot
Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @corona10 for commit 03abe46 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F150396%2Fmerge

The command will test the builders whose names match following regular expression: macOS

The builders matched are:

  • x86-64 MacOS Intel NoGIL PR
  • x86-64 MacOS Intel ASAN NoGIL PR
  • x86-64 macOS PR
  • ARM64 MacOS M1 Refleaks NoGIL PR
  • ARM64 MacOS M1 NoGIL PR
  • ARM64 macOS PR

Copy link
Copy Markdown
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.

Recently, code to get the memory usage of the current process was removed from the GC: https://github.com/python/cpython/pull/149475/changes#diff-4722ae850a2da3e12f50815c0e3932627ebe67edeaa8b7f28a94f20c8698204dL2022. I used task_info(mach_task_self(), TASK_VM_INFO, ...) and gets vm_info.phys_footprint. In private, @corona10 told me that task_info() cannot be used to get the memory usage of other processes.

@vstinner
Copy link
Copy Markdown
Member

psutil also uses proc_pidinfo(PROC_PIDTASKINFO) API to get the RSS memory of a process: https://github.com/giampaolo/psutil/blob/1a2569db0b2ad7489539ad6b6b6b85cb13b755f7/psutil/arch/osx/proc.c#L136-L154.

@corona10
Copy link
Copy Markdown
Member Author

!buildbot macOS

@bedevere-bot
Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @corona10 for commit e3870ab 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F150396%2Fmerge

The command will test the builders whose names match following regular expression: macOS

The builders matched are:

  • x86-64 MacOS Intel NoGIL PR
  • x86-64 MacOS Intel ASAN NoGIL PR
  • x86-64 macOS PR
  • ARM64 MacOS M1 Refleaks NoGIL PR
  • ARM64 MacOS M1 NoGIL PR
  • ARM64 macOS PR

Comment thread Modules/_testcapi/mem.c
Copy link
Copy Markdown
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.

You should run make clinic, no?

Comment thread Modules/_testcapi/mem.c
@corona10
Copy link
Copy Markdown
Member Author

You should run make clinic, no?

Why? I didnt use AC at here

Copy link
Copy Markdown
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 if the macOS jobs in GitHub Action and macOS jobs on buildbots are happy with this change.

I don't have access to macOS to test the PR.

Why? I didnt use AC at here

Oops, you're right. I was confused by other C functions using AC.

@corona10 corona10 merged commit c714b56 into python:main May 25, 2026
56 checks passed
@corona10 corona10 deleted the gh-150114-macos branch May 25, 2026 15:03
@vstinner
Copy link
Copy Markdown
Member

Thanks for adding macOS support!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants