10
105
Fork
You've already forked web
30

Fix memory leak: clean up setTimeout timers in overpassFetcher #2511

Merged
laem merged 1 commit from fuite-memoire into master 2026年07月12日 14:09:08 +02:00
Owner
Copy link

The resilientOverpassFetch function was creating setTimeout timers for each
Overpass server attempt without cleaning them up. These timers accumulated
in Node.js's event loop, causing memory to grow until the process crashed with
'JavaScript heap out of memory' error approximately every 6 minutes.

Fix:

  • Track all timeout IDs in a timeoutIds array
  • Add cleanup() function to clearTimeout on all tracked IDs
  • Call cleanup() on success, failure, and when falling back to pending fetches
  • Also fix clearInterval in useSearchLocalTransit to use interval ID instead of function

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe vibe@mistral.ai

The resilientOverpassFetch function was creating setTimeout timers for each Overpass server attempt without cleaning them up. These timers accumulated in Node.js's event loop, causing memory to grow until the process crashed with 'JavaScript heap out of memory' error approximately every 6 minutes. Fix: - Track all timeout IDs in a timeoutIds array - Add cleanup() function to clearTimeout on all tracked IDs - Call cleanup() on success, failure, and when falling back to pending fetches - Also fix clearInterval in useSearchLocalTransit to use interval ID instead of function Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
The resilientOverpassFetch function was creating setTimeout timers for each
Overpass server attempt without cleaning them up. These timers accumulated
in Node.js's event loop, causing memory to grow until the process crashed with
'JavaScript heap out of memory' error approximately every 6 minutes.
Fix:
- Track all timeout IDs in a timeoutIds array
- Add cleanup() function to clearTimeout on all tracked IDs
- Call cleanup() on success, failure, and when falling back to pending fetches
- Also fix clearInterval in useSearchLocalTransit to use interval ID instead of function
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Author
Owner
Copy link

Les deux changements me semble intelligents, on aurait galéré à les trouver tout seul je pense ! Si c'est pas ça, dans tous les cas ça fera pas de mal.

Les deux changements me semble intelligents, on aurait galéré à les trouver tout seul je pense ! Si c'est pas ça, dans tous les cas ça fera pas de mal.
laem deleted branch fuite-memoire 2026年07月12日 14:09:09 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
🎨 Design
À propos de l'interface et de l'UX
💡 Idée
Nouvelle feature à intégrer
question
Further information is requested
🌍 OSM
À propos de l'affichage et l'édition des éléments OSM
🌱 Amélioration
Amélioration/fix de l'existant
🐞 Bug
Something isn't working
📊 SEO
📋 Catégories
À propos des catégories de recherche et de l'annuaire
📖 Wiki
📝Avis
A propos de la fonction avis et de bluesky
📢 Oyez
📷 Photos
A propos des photos (sources, affichage)
🔍Recherche
A propos de la barre de recherche et de photon
🔥 Actuel
🔧 tech
🖌 Styles
Styles de la carte
🧝i18n
🧪 R&D
🚍 Transports
🚙 Voiture
🚨Prioritaire
Ticket à traiter rapidement
🚲Vélo
Cartes
climat
Communication
demo
Cette branche doit être déployée comme une démo
dependencies
Pull requests that update a dependency file
javascript
Pull requests that update javascript code
Pas urgent
Plein-air
Tuiles
Verso
Vieux
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cartes/web!2511
Reference in a new issue
cartes/web
No description provided.
Delete branch "fuite-memoire"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?