René's URL Explorer Experiment


Title: Potential memory leak in SimpleHeap's removed_node_tuples · Issue #71 · brean/python-pathfinding · GitHub

Open Graph Title: Potential memory leak in SimpleHeap's removed_node_tuples · Issue #71 · brean/python-pathfinding

X Title: Potential memory leak in SimpleHeap's removed_node_tuples · Issue #71 · brean/python-pathfinding

Description: Hey there, I've been investigating a memory issue in the SimpleHeap implementation and found that removed_node_tuples can grow indefinitely during pathfinding, especially on larger grids. The problem is that when nodes are "removed" via ...

Open Graph Description: Hey there, I've been investigating a memory issue in the SimpleHeap implementation and found that removed_node_tuples can grow indefinitely during pathfinding, especially on larger grids. The probl...

X Description: Hey there, I've been investigating a memory issue in the SimpleHeap implementation and found that removed_node_tuples can grow indefinitely during pathfinding, especially on larger grids. The p...

Opengraph URL: https://github.com/brean/python-pathfinding/issues/71

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Potential memory leak in SimpleHeap's removed_node_tuples","articleBody":"Hey there, I've been investigating a memory issue in the SimpleHeap implementation and found that `removed_node_tuples` can grow indefinitely during pathfinding, especially on larger grids.\n\nThe problem is that when nodes are \"removed\" via `remove_node()`, they get added to `removed_node_tuples` but are never cleaned up. Over time, this set just keeps growing.\n\nAfter digging into the code, I'm wondering if `removed_node_tuples` is actually necessary at all? From what I can see, the A* algorithm already marks processed nodes with the closed flag, so we could potentially simplify things by:\n\n1. Getting rid of `removed_node_tuples` completely\n2. Having `pop_node()` just skip any nodes that are already closed\n3. Making `remove_node()` do nothing (or removing it entirely)\n\nSomething like:\n```\ndef pop_node(self):\n    while self.open_list:\n        node_tuple = heapq.heappop(self.open_list)\n        # ... get node from tuple ...\n        if not node.closed:\n            return node\n    return None\n```\n\nI tested this approach and it seems to work correctly while eliminating the memory leak. The pathfinding results are identical, but without the growing memory usage.\n\nIs there a specific reason removed_node_tuples was implemented this way, or would you be interested in a PR that simplifies this? I might be missing some edge case that requires the current approach, so wanted to check first.\n\nThanks!","author":{"url":"https://github.com/codelion","@type":"Person","name":"codelion"},"datePublished":"2025-08-15T01:27:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/71/python-pathfinding/issues/71"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a8fb55f9-9e23-d04e-cd0d-0ff9c22a5f6b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id95AA:D6EC3:60C35A:7D06A1:698D2368
html-safe-nonce35e4c9b68fa82bd9275ce30fad5af8b623de2dc4607c77c2b7a60ca260316cc0
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUFBOkQ2RUMzOjYwQzM1QTo3RDA2QTE6Njk4RDIzNjgiLCJ2aXNpdG9yX2lkIjoiODA1NzAyMTYzMTU3MzA3NDc5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac8d7db386cc279d8aec086bcdb3519c6749aa8c48719977aece0ee3957e25af15
hovercard-subject-tagissue:3324056333
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/brean/python-pathfinding/71/issue_layout
twitter:imagehttps://opengraph.githubassets.com/573f4db41e8b4870734bd0f8008059da025c74174b195e8bd0716b35673e3608/brean/python-pathfinding/issues/71
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/573f4db41e8b4870734bd0f8008059da025c74174b195e8bd0716b35673e3608/brean/python-pathfinding/issues/71
og:image:altHey there, I've been investigating a memory issue in the SimpleHeap implementation and found that removed_node_tuples can grow indefinitely during pathfinding, especially on larger grids. The probl...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecodelion
hostnamegithub.com
expected-hostnamegithub.com
Nonec25395580e1e3bf82d705e0982a1b24255366088720fef945f1493d5e3e67954
turbo-cache-controlno-preview
go-importgithub.com/brean/python-pathfinding git https://github.com/brean/python-pathfinding.git
octolytics-dimension-user_id229768
octolytics-dimension-user_loginbrean
octolytics-dimension-repository_id32716626
octolytics-dimension-repository_nwobrean/python-pathfinding
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id32716626
octolytics-dimension-repository_network_root_nwobrean/python-pathfinding
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
release94219dcb9c044792ec271fd5b23c73419858bef7
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/brean/python-pathfinding/issues/71#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbrean%2Fpython-pathfinding%2Fissues%2F71
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://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbrean%2Fpython-pathfinding%2Fissues%2F71
Sign up https://patch-diff.githubusercontent.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=brean%2Fpython-pathfinding
Reloadhttps://patch-diff.githubusercontent.com/brean/python-pathfinding/issues/71
Reloadhttps://patch-diff.githubusercontent.com/brean/python-pathfinding/issues/71
Reloadhttps://patch-diff.githubusercontent.com/brean/python-pathfinding/issues/71
brean https://patch-diff.githubusercontent.com/brean
python-pathfindinghttps://patch-diff.githubusercontent.com/brean/python-pathfinding
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fbrean%2Fpython-pathfinding
Fork 73 https://patch-diff.githubusercontent.com/login?return_to=%2Fbrean%2Fpython-pathfinding
Star 370 https://patch-diff.githubusercontent.com/login?return_to=%2Fbrean%2Fpython-pathfinding
Code https://patch-diff.githubusercontent.com/brean/python-pathfinding
Issues 24 https://patch-diff.githubusercontent.com/brean/python-pathfinding/issues
Pull requests 0 https://patch-diff.githubusercontent.com/brean/python-pathfinding/pulls
Actions https://patch-diff.githubusercontent.com/brean/python-pathfinding/actions
Projects 2 https://patch-diff.githubusercontent.com/brean/python-pathfinding/projects
Wiki https://patch-diff.githubusercontent.com/brean/python-pathfinding/wiki
Security 0 https://patch-diff.githubusercontent.com/brean/python-pathfinding/security
Insights https://patch-diff.githubusercontent.com/brean/python-pathfinding/pulse
Code https://patch-diff.githubusercontent.com/brean/python-pathfinding
Issues https://patch-diff.githubusercontent.com/brean/python-pathfinding/issues
Pull requests https://patch-diff.githubusercontent.com/brean/python-pathfinding/pulls
Actions https://patch-diff.githubusercontent.com/brean/python-pathfinding/actions
Projects https://patch-diff.githubusercontent.com/brean/python-pathfinding/projects
Wiki https://patch-diff.githubusercontent.com/brean/python-pathfinding/wiki
Security https://patch-diff.githubusercontent.com/brean/python-pathfinding/security
Insights https://patch-diff.githubusercontent.com/brean/python-pathfinding/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/brean/python-pathfinding/issues/71
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/brean/python-pathfinding/issues/71
Potential memory leak in SimpleHeap's removed_node_tupleshttps://patch-diff.githubusercontent.com/brean/python-pathfinding/issues/71#top
https://github.com/codelion
https://github.com/codelion
codelionhttps://github.com/codelion
on Aug 15, 2025https://github.com/brean/python-pathfinding/issues/71#issue-3324056333
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.