Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Excessive QSBR memory usage when delay freeing large blocks. #132519

Open
Labels
@tom-pytel

Description

@tom-pytel

Bug report

Bug description:

I ran across this while profiling memory usage in#130771. The results are same for both that andlist objects which use QSBR to free memory, so this is a QSBR thing. Note this is an extreme synthetic case, this CAN happen but does not mean it WILL happen in real-world apps.

Memory usage numbers:

             VmHWMGIL      135104 kB  - normal GIL-enabled baselinenoGIL   6702788 kB  - free-threaded current QSBR behavior

Test script:

importthreadingfromqueueimportQueuedefthrdfunc(queue):whileTrue:l=queue.get()l.append(0)# force resize in non-parent thread which will free using _PyMem_FreeDelayed()queue=Queue(maxsize=2)threading.Thread(target=thrdfunc,args=(queue,)).start()whileTrue:l= [None]*int(3840*2160*3/8)# sys.getsizeof(l) ~= 3840*2160*3 bytesqueue.put(l)

See PR for proposed fix.

CPython versions tested on:

3.14

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp