René's URL Explorer Experiment


Title: `PyThreadState` and `PyInterpreterState` are not freed · Issue #99205 · python/cpython · GitHub

Open Graph Title: `PyThreadState` and `PyInterpreterState` are not freed · Issue #99205 · python/cpython

X Title: `PyThreadState` and `PyInterpreterState` are not freed · Issue #99205 · python/cpython

Description: The following test program gains about 10M per second under top, on Python 3.11 only (confirmed for all development stages: 3.11.0a4, 3.11.0b1, 3.11.0rc1, 3.11.0) . 3.10 shows no memory growth. from threading import Thread while True: t1...

Open Graph Description: The following test program gains about 10M per second under top, on Python 3.11 only (confirmed for all development stages: 3.11.0a4, 3.11.0b1, 3.11.0rc1, 3.11.0) . 3.10 shows no memory growth. fro...

X Description: The following test program gains about 10M per second under top, on Python 3.11 only (confirmed for all development stages: 3.11.0a4, 3.11.0b1, 3.11.0rc1, 3.11.0) . 3.10 shows no memory growth. fro...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`PyThreadState` and `PyInterpreterState` are not freed","articleBody":"The following test program gains about 10M per second under top, on Python 3.11 only (confirmed for all development stages: 3.11.0a4, 3.11.0b1, 3.11.0rc1, 3.11.0)  .  3.10 shows no memory growth.\r\n\r\n```py\r\nfrom threading import Thread\r\n\r\nwhile True:\r\n    t1 = Thread()\r\n    t1.start()\r\n```\r\n\r\nFor direct results, here's the same program using the `resource` module that I just saw used over at #98467:\r\n\r\n```py\r\nfrom threading import Thread\r\nimport resource\r\n\r\nprint(\"Before\", resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1024, \"MB\")\r\n\r\ni = 0\r\n\r\nwhile True:\r\n    i += 1\r\n    t1 = Thread()\r\n    t1.start()\r\n    if i % 10000 == 0:\r\n        print(\r\n            f\"memory after {i} iterations:\",\r\n            resource.getrusage(resource.RUSAGE_SELF).ru_maxrss / 1024,\r\n            \"MB\",\r\n        )\r\n```\r\n\r\nThe above program under Py 3.11.0 prints:\r\n\r\n```\r\n$ .venv-3.11/bin/python test5.py \r\nBefore 8.14453125 MB\r\nmemory after 10000 iterations: 11.6875 MB\r\nmemory after 20000 iterations: 15.30078125 MB\r\nmemory after 30000 iterations: 18.65234375 MB\r\nmemory after 40000 iterations: 22.26171875 MB\r\nmemory after 50000 iterations: 25.87109375 MB\r\nmemory after 60000 iterations: 29.22265625 MB\r\nmemory after 70000 iterations: 32.83203125 MB\r\nmemory after 80000 iterations: 36.44140625 MB\r\nmemory after 90000 iterations: 39.78125 MB\r\nmemory after 100000 iterations: 43.390625 MB\r\n...\r\n```\r\n\r\nunder Python 3.10 it prints:\r\n\r\n```\r\n$ .venv-3.10/bin/python test5.py \r\nBefore 9.25 MB\r\nmemory after 10000 iterations: 9.46484375 MB\r\nmemory after 20000 iterations: 9.47265625 MB\r\nmemory after 30000 iterations: 9.47265625 MB\r\nmemory after 40000 iterations: 9.47265625 MB\r\nmemory after 50000 iterations: 9.47265625 MB\r\nmemory after 60000 iterations: 9.47265625 MB\r\nmemory after 70000 iterations: 9.47265625 MB\r\nmemory after 80000 iterations: 9.47265625 MB\r\n```\r\n\r\n\r\nthe issue looks extremely similar to another one we just fixed in greenlet, over at https://github.com/python-greenlet/greenlet/issues/328, although this one is much more surprising.    Issue #98467 might also be related.\r\n\r\n\r\nEnvironment:\r\n```\r\n$ uname -a\r\nLinux photon3 5.17.14-200.fc35.x86_64 #1 SMP PREEMPT Thu Jun 9 14:02:42 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux\r\n\r\n$ python3\r\nPython 3.11.0 (main, Nov  5 2022, 23:27:22) [GCC 11.3.1 20220421 (Red Hat 11.3.1-3)] on linux\r\n```\r\n\n\n\u003c!-- gh-pr-number: gh-99268 --\u003e\n* PR: gh-99268\n\u003c!-- /gh-pr-number --\u003e\n\n\n\u003c!-- gh-pr-number: gh-99301 --\u003e\n* PR: gh-99301\n\u003c!-- /gh-pr-number --\u003e\n\n\n\u003c!-- gh-pr-number: gh-99385 --\u003e\n* PR: gh-99385\n\u003c!-- /gh-pr-number --\u003e\n","author":{"url":"https://github.com/zzzeek","@type":"Person","name":"zzzeek"},"datePublished":"2022-11-07T15:11:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/99205/cpython/issues/99205"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:399d40f1-7b3a-bf60-3f0c-62d38a143604
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idADEC:240939:F7FCB7:14BD54A:69699137
html-safe-nonce202254e168aec99feb04411ac36282aea4049d8f4487500076642a4f5d3e1d63
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBREVDOjI0MDkzOTpGN0ZDQjc6MTRCRDU0QTo2OTY5OTEzNyIsInZpc2l0b3JfaWQiOiI4MjE2ODMzNTg5Mzc4NjUwNDIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac8202636c7b88925d800166179e92afaf3e0aba69be67874aba728efc66fa066f
hovercard-subject-tagissue:1438527053
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/99205/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ae527d7dffc27062f53c89cf4d56064dd3ac0e2c41f85f011ea89e133686e073/python/cpython/issues/99205
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ae527d7dffc27062f53c89cf4d56064dd3ac0e2c41f85f011ea89e133686e073/python/cpython/issues/99205
og:image:altThe following test program gains about 10M per second under top, on Python 3.11 only (confirmed for all development stages: 3.11.0a4, 3.11.0b1, 3.11.0rc1, 3.11.0) . 3.10 shows no memory growth. fro...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamezzzeek
hostnamegithub.com
expected-hostnamegithub.com
None3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751
turbo-cache-controlno-preview
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
releaseaf80af7cc9e3de9c336f18b208a600950a3c187c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/99205#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F99205
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%2F99205
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/99205
Reloadhttps://github.com/python/cpython/issues/99205
Reloadhttps://github.com/python/cpython/issues/99205
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/99205
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/99205
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/99205
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/99205
PyThreadState and PyInterpreterState are not freedhttps://github.com/python/cpython/issues/99205#top
https://github.com/brandtbucher
3.11only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.11%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/zzzeek
https://github.com/zzzeek
zzzeekhttps://github.com/zzzeek
on Nov 7, 2022https://github.com/python/cpython/issues/99205#issue-1438527053
#98467https://github.com/python/cpython/issues/98467
python-greenlet/greenlet#328https://github.com/python-greenlet/greenlet/issues/328
#98467https://github.com/python/cpython/issues/98467
GH-99205: Mark new interpreters and threads as non-static #99268https://github.com/python/cpython/pull/99268
[3.11] GH-99205: Mark new interpreters and threads as non-static (GH-99268) #99301https://github.com/python/cpython/pull/99301
GH-99205: remove _static field from PyThreadState and PyInterpreterState #99385https://github.com/python/cpython/pull/99385
brandtbucherhttps://github.com/brandtbucher
3.11only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.11%22
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
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.