Skip to content

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

Open
corona10 wants to merge 4 commits into
python:mainfrom
corona10:gh-150114-macos
Open

gh-150114: Log the memory usage in regrtest on macOS#150396
corona10 wants to merge 4 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
@@ -702,7 +715,22 @@ get_process_memory_usage(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "i", &pid)) {
return NULL;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add an empty line for readability.

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