CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.71k stars 3.44k forks source link

Memory Leaks #10597

Open Saumya-NebCodes opened 2 years ago

Saumya-NebCodes commented 2 years ago

When creating new Cesium Viewer in an Angular app, JS heap doesn't get cleared on page change. when navigating between the pages the bug seems to appears(refreshing the page clears the heap memory). Below is the sample app attached cesium_angular.zip.

Application Installation steps:

npm install ng serve

cesium_angular.zip

App running on http://localhost:4200

Steps to reproduce:

Screenshot Chrome Performance Tab

Screenshot from 2022-07-26 20-05-10

The main issue which I am facing is that when I am trying to load high resolution images, it loads 2-3 times but after that webpage crashes. (memory never clears on page change, It keeps on increasing until the page crashes)

ebolainfluenza commented 3 months ago

Have you guys noticed how much memory your JulianDate component uses? It's extreme, a large percent of a large project. I used Firefox DevTools to grab a snapshot of memory 1) upon initial load of our app using Cesium, then 2) upon subsequent page unloads/reloads. Each reload of the page accumulates much more memory (MBs). Record CallStacks, and aggregate the data by CallStack, then drill down into rows using the largest number of bytes. Almost without fail: JulianDate.