René's URL Explorer Experiment


Title: GitHub · Where software is built

Open Graph Title: python/cpython

X Title: python/cpython

Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.

Open Graph Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.

X Description: The Python programming language. Contribute to python/cpython development by creating an account on GitHub.

Opengraph URL: https://github.com/python/cpython

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sub-interpreters: significant memory leak on shutdown","articleBody":"# Bug report\r\n\r\n### Bug description:\r\n\r\nHi all, congrats on the new Python release, very keen on the direction that sub-interpreters are taking!\r\n\r\nI noticed that constructing and destructing sub-interpreters now causes memory to be leaked. This was not a problem in 3.11, but is as of 3.12 and occurs on latest main branch too (as of 8c071373f12f325c54591fe990ec026184e48f8f). I figure it must relate to the changes made to split up the interpreter states.\r\n\r\nI can consistently replicate the issue using simply:\r\n```python\r\nimport _xxsubinterpreters\r\nwhile 1:\r\n    interp = _xxsubinterpreters.create()\r\n    _xxsubinterpreters.destroy(interp)\r\n```\r\nYou'll notice the memory usage climb quite quickly if you look at top/htop.\r\n\r\nvalgrind/massif think the culprit are interned strings, specifically here:\r\n```\r\n==219777==    at 0x4848A13: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)\r\n==219777==    by 0x2DA59E: PyMem_RawCalloc (obmalloc.c:671)\r\n==219777==    by 0x2DA59E: arena_map_get (obmalloc.c:1021)\r\n==219777==    by 0x2DA59E: arena_map_mark_used (obmalloc.c:1076)\r\n==219777==    by 0x2DAA71: new_arena (obmalloc.c:1209)\r\n==219777==    by 0x2DAA71: allocate_from_new_pool (obmalloc.c:1389)\r\n==219777==    by 0x2DB00B: pymalloc_alloc (obmalloc.c:1553)\r\n==219777==    by 0x2DB00B: _PyObject_Malloc (obmalloc.c:1564)\r\n==219777==    by 0x424AF5: gc_alloc (gcmodule.c:2304)\r\n==219777==    by 0x424AF5: _PyObject_GC_New (gcmodule.c:2319)\r\n==219777==    by 0x2BDF3B: new_dict (dictobject.c:748)\r\n==219777==    by 0x2BDF3B: PyDict_New (dictobject.c:851)\r\n==219777==    by 0x34CF06: init_interned_dict (unicodeobject.c:248)\r\n==219777==    by 0x34CF06: _PyUnicode_InitGlobalObjects (unicodeobject.c:14670)\r\n==219777==    by 0x3EDE18: pycore_init_global_objects (pylifecycle.c:678)\r\n==219777==    by 0x3EDE18: pycore_interp_init (pylifecycle.c:826)\r\n==219777==    by 0x3F07A9: new_interpreter (pylifecycle.c:2079)\r\n==219777==    by 0x3F07A9: Py_NewInterpreterFromConfig (pylifecycle.c:2114)\r\n==219777==    by 0x4867A52: interp_create (_xxsubinterpretersmodule.c:516)\r\n==219777==    by 0x2D0C22: cfunction_call (methodobject.c:537)\r\n==219777==    by 0x2716A7: _PyObject_MakeTpCall (call.c:240)\r\n```\r\n\r\nI had a look around that code but I can't spot any obvious bug. I did verify that the interned strings dict created and destroyed in `clear_interned_dict()` is the same for each sub-interpreter, just in case.\r\n\r\nI think every interned string is now also automatically immortal. Does that mean it wouldn't be cleaned up even if the refcount goes down to zero?\r\n\r\n### CPython versions tested on:\r\n\r\n3.11, 3.12, CPython main branch\r\n\r\n### Operating systems tested on:\r\n\r\nLinux","author":{"url":"https://github.com/costasgambit","@type":"Person","name":"costasgambit"},"datePublished":"2023-10-05T17:09:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/110411/cpython/issues/110411"}

route-pattern/:user_id/:repository/issues/:id(.:format)
route-controllerissues
route-actionshow
fetch-noncev2:d84ce741-0fe8-c2ac-006a-856e46fcd2ab
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE7D4:36099A:13EE9B8:1BF5F6D:696A4174
html-safe-nonce68d47e66d9fbc1cade3af6e4b8631f9d108726bb13d028037088fc062a541bc6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFN0Q0OjM2MDk5QToxM0VFOUI4OjFCRjVGNkQ6Njk2QTQxNzQiLCJ2aXNpdG9yX2lkIjoiMzU0MzQ5MzAyMzM1OTQ1MTUwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8a34e0545adfaa0c26ce3910b9d310370ecff4a5a70644cfec4c8aec340fb3c4
hovercard-subject-tagrepository:81598961
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///issues/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/issues/110411
twitter:imagehttps://opengraph.githubassets.com/c78f0071ebe525a0315b101d2bed1f4e309076c218f0a77de3892a5bac112691/python/cpython
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c78f0071ebe525a0315b101d2bed1f4e309076c218f0a77de3892a5bac112691/python/cpython
og:image:altThe Python programming language. Contribute to python/cpython development by creating an account on GitHub.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None3f871c8e07f0ae1886fa8dac284166d28b09ad5bada6476fc10b674e489788ef
turbo-cache-controlno-cache
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release63c426b30d262aba269ef14c40e3c817b384cd61
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/110411#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F110411
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F110411
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fissues%2Fshow&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/110411
Reloadhttps://github.com/python/cpython/issues/110411
Reloadhttps://github.com/python/cpython/issues/110411
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/110411
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/issues/110411
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/110411
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/110411
#140067https://github.com/python/cpython/issues/140067
#140067https://github.com/python/cpython/issues/140067
sub-interpreters: significant memory leak on shutdownhttps://github.com/python/cpython/issues/110411#top
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-subinterpretershttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-subinterpreters%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/costasgambit
https://github.com/costasgambit
costasgambithttps://github.com/costasgambit
on Oct 5, 2023https://github.com/python/cpython/issues/110411#issue-1928726290
8c07137https://github.com/python/cpython/commit/8c071373f12f325c54591fe990ec026184e48f8f
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-subinterpretershttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-subinterpreters%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
Subinterpretershttps://github.com/orgs/python/projects/3
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.