GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Name arenas allocated by `mmap` in `_PyMem_ArenaAlloc` for debugging · Issue #141770 · python/cpython

Name arenas allocated by mmap in _PyMem_ArenaAlloc for debugging #141770

New issue
Copy link
New issue
Copy link
Closed
Closed
Name arenas allocated by mmap in _PyMem_ArenaAlloc for debugging#141770
Copy link
Assignees
corona10
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement

Description

@SpecLad
SpecLad
opened on Nov 19, 2025
Issue body actions

Feature or enhancement

Proposal:

In Linux 5.17 a new feature was added, PR_SET_VMA_ANON_NAME, which lets you give names to anonymous virtual memory ranges. These names are shown in /proc/<pid>/maps, which can help with debugging.

The pymalloc allocator uses mmap to allocate arenas. It should use PR_SET_VMA_ANON_NAME to give names to the memory ranges containing arenas, e.g. "Python: arena".

Some examples of this done for other languages are in Glibc and Go.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

  • gh-141770: Annotate anonymous mmap usage if "-X dev" is used #142079

Activity

  1. SpecLad
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Nov 19, 2025
  2. StanFromIreland
    added
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Nov 19, 2025
  3. picnixz commented on Nov 22, 2025

    @picnixz
    picnixz
    on Nov 22, 2025 · Hidden as resolved
    show commentMore actions
  4. picnixz
    changed the title [-]Name arena memory regions[/-] [+]Name arenas allocated by `mmap` in `_PyMem_ArenaAlloc` for debugging[/+] on Nov 22, 2025
  5. picnixz
    self-assigned this
    on Nov 22, 2025
  6. picnixz commented on Nov 22, 2025

    @picnixz
    picnixz
    on Nov 22, 2025
    Member
    More actions

    Urhg... It's funny but... I cannot test this because I don't have a recent enough Linux kernel :D

  7. picnixz
    removed their assignment
    on Nov 22, 2025
  8. corona10
    self-assigned this
    on Nov 28, 2025
  9. corona10
    added a commit that references this issue on Nov 28, 2025

    pythongh-141770: Annotate anonymous mmap only for debug build

    0e3933d
  10. corona10 commented on Nov 29, 2025

    @corona10
    corona10
    on Nov 29, 2025
    Member
    More actions

    Working and verifying in my local environment.
    This feature should be enabled by kernel config itself too.
    https://bugzilla.redhat.com/show_bug.cgi?id=2302746

  11. encukou commented on Dec 1, 2025

    @encukou
    encukou
    on Dec 1, 2025
    Member
    More actions

    Should this be exposed to users, with something like mmap.mmap(..., name=...)?

    Reacted by Sam James and Donghee Na
  12. corona10
    added 2 commits that reference this issue on Dec 4, 2025

    Merge remote-tracking branch 'upstream/main' into pythongh-141770

    8f77e0d

    gh-141770: Annotate anonymous mmap usage if "-X dev" is used (gh-142079)

    c4ccaf4
  13. corona10
    closed this as completedon Dec 8, 2025
  14. corona10 commented on Dec 8, 2025

    @corona10
    corona10
    on Dec 8, 2025
    Member
    More actions

    Should this be exposed to users, with something like mmap.mmap(..., name=...)?

    Nice idea, I will pile a new issue.

  15. vstinner commented on Dec 8, 2025

    @vstinner
    vstinner
    on Dec 8, 2025
    Member
    More actions

    Should this be exposed to users, with something like mmap.mmap(..., name=...)?

    Since it's only supported on Linux, I'm not sure that it's a good idea.

  16. hugovk
    added a commit that references this issue on Dec 10, 2025

    Revert "pythongh-141770: Annotate anonymous mmap usage if "-X dev" is…

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

Metadata

Metadata

Assignees

  • @corona10
    corona10

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.