CesiumGS / CesiumGS/cesium

Serious memory leak in Resource in node.js and other environments caused by RequestScheduler.activeRequests

Open
#7,670 5 comments 0 reactions 0 assignees View on GitHub
category - modernization category - node / npm type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

### The 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](https://gist.github.com/bkuster/8aaf5658951d4e68f70e63f04221318a)). This leads to the following profile over 90 seconds:
![Capture](https://user-images.githubusercontent.com/11855207/54823191-59b82300-4ca7-11e9-9c5f-650a9b7bd513.JPG)

For some reason, the `listeners` keep on rising, we are currently trying to get to the bottom of this and would welcome any input.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by calling sampleTerrainMostDetailed repeatedly, then inspect RequestScheduler.activeRequests and the listener count in the browser or Node.js. Use the linked Sandcastle gist and memory profile as references; done means repeated calls no longer cause external memory or listener usage to keep rising.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
performance, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.