Serious memory leak in Resource in node.js and other environments caused by RequestScheduler.activeRequests
See original GitHub issueThe Issue
When using sampleTerrainMostDetailed
often (thousands of times), the memory usage slowly rises.
Inspections
In node
this leads to a large external
memory usage over time. We managed to replicate the problem in the browser (see this sandcastle gist). This leads to the following profile over 90 seconds:
For some reason, the listeners
keep on rising, we are currently trying to get to the bottom of this and would welcome any input.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Debugging Memory Leaks in Node.js Applications - Toptal
Memory leaks in long running Node.js applications are like ticking time bombs that, if left unchecked in production environments, can result in devastating ......
Read more >Node.js Memory Leak Detection: How to Debug & Avoid Them
Learn what Node.js memory leaks are. Discover common causes and go through the whole debugging process, from detection to fixing and ...
Read more >Memory leaks in NodeJS application?! | by Gaspar Nagy
What can cause a memory leak? Global Variables. They stay in memory until the application stops. That's why it is dangerous to set...
Read more >Understanding memory leaks in Node.js apps - LogRocket Blog
In this article, we are going to learn what memory leaks are, what causes them, and their implications in a Node.js application.
Read more >[Bug]: Memory consumption issues on Node JS 16.11.0+ ...
0) because of this issue. We bisected the changes and identified that the upgrade from Node 16.10 to 16.11 caused our large Jest...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@shunter Thanks, when i add RequestScheduler.update() after each sampleTerrain call the memory footprint keeps stable. Maybe this could be documented for methods which can be used without the render loop?
I somehow missed this issue the first time around but @kring just ran into it.
Couldn’t we just have RequestSchedule run
update
on itself no more than once a frame? Rather than installing a constant even into the event loop, we could have it useprocess.nextTick
and only install the one time handler after a request has resolved.I may not be explaining it well, but I think this is an easy fix.