Skip to content

bpo-46430: fix memory leak in interned strings of deep-frozen modules#31549

Merged
vstinner merged 2 commits intopython:mainfrom
kumaraditya303:mem
Feb 24, 2022
Merged

bpo-46430: fix memory leak in interned strings of deep-frozen modules#31549
vstinner merged 2 commits intopython:mainfrom
kumaraditya303:mem

Conversation

@kumaraditya303
Copy link
Copy Markdown
Contributor

@kumaraditya303 kumaraditya303 commented Feb 24, 2022

Valgrind log after fix:

==17044== 
==17044== HEAP SUMMARY:
==17044==     in use at exit: 0 bytes in 0 blocks
==17044==   total heap usage: 18,385 allocs, 18,385 frees, 2,558,621 bytes allocated
==17044== 
==17044== All heap blocks were freed -- no leaks are possible
==17044== 
==17044== Use --track-origins=yes to see where uninitialised values come from
==17044== For lists of detected and suppressed errors, rerun with: -s
==17044== ERROR SUMMARY: 39 errors from 11 contexts (suppressed: 0 from 0)

Python output:

@kumaraditya303 ➜ /workspaces/cpython (mem ✗) $ ./python -X showrefcount -c pass
[0 refs, 0 blocks]

https://bugs.python.org/issue46430

@kumaraditya303 kumaraditya303 changed the title bpo-46430: fix memory leak in interned deep-frozen modules bpo-46430: fix memory leak in interned strings of deep-frozen modules Feb 24, 2022
@kumaraditya303
Copy link
Copy Markdown
Contributor Author

cc @gvanrossum @vstinner

Copy link
Copy Markdown
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

@vstinner
Copy link
Copy Markdown
Member

Merged, thanks.

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.

5 participants