CesiumGS / CesiumGS/cesium

Memory leak using pickFromRayMostDetailed

Open
#11,680 1 comment 0 reactions 0 assignees View on GitHub
category - 3d tiles category - memory/performance
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
3d 15h
Merged PRs (30d)
32

Description

I'm currently working on a basic path planning implementation (RRT) in cesium using custom 3D tiles as basis. It involves creating random points in 3D and then checking if the point can be reached. The check is done using a ray cast. A lot of them > 100000.

I first used pickFromRay, but it can only use the currently loaded tiles and often fails to detect a collision. pickFromRayMostDetailed seemed to be the correct way to deal with that. I knew it would be terribly slow but the result would be correct.

Unfortunately, using most detailed fills up the VM heap until the tab crashes. It seems that the tiles for the ray cast are loaded but never freed.

I made a sandcastle example to show the behavior. Just press "Run RayCast" an see the heap fill up until it crashes.
It seems that the sandcastle example is somehow tied into the frame rate and takes a while to crash. In my own project, it fails within a few minutes and ca. 80000 raycasts.

Sandcastle example: [Example](https://sandcastle.cesium.com/#c=jVXbbuM2EP0VwuiDjMi07rISJ+g2TtuHXTTIBn3yw9LSJCaWJg2Sste7yL93qIsvsQNUAmRzLmeGM2fIUkljyYbDFjS5JRK25B4Mr1f030bmzQdls75X0jIuQc8HPvk1l4RYvgKBkmvywoQB38mY5CtmuZLHQlOChC+qgkdefgd9rFowA5/ZDvS5ajwmz0sgr0ItgFQKDJHKYoJQEauIk3GzFuhb9eaGyxKIRafHpbJKAxPcWF6SeEaeuUAENBB1hTagNW7G+TX4h7hvw5s5yhHtQbKFAKJBVqC5fG2AzffdXLbVos22KEo+2ZUy6yVoXC3VFstodQ09zqeq+iifubR61xazbPpgnRQsIrAt47ZvRYmuFv5S6lXAKVQ8e25dPJc3ISeprTVfccs3YCirKq8Dd4ZvpGS2XBIP66D08JCCEkCFevW+PTgFEYpVbusf1bODpM79t18N2Nu3JoDb/IY5BHS/JaMwimgwiSZZUsSTOA6SMMvTm86GuR3HOU2iKAiTIksnRZSleRyENz3OWhm06epxz7TFf0zG9EWr1QxeNYDxXCzfofkkCoK+kbh19ObS7hsH0mJZuqo0Wz88GIe3/HUR/fdKhLkm71zc4/p+3bTdP1eWSiikdp+8W9Gnh9kFyzX/AeIr/4mEDIN3ulPrtyPvjrMN2x5dig1VS7YCzQhrVy151gJ+vONva0axi27g23JUgG2W3RwfHQmHuntt9FGUFXFe5DRNwyALkjzv0holUZGHcUrTMA+KJI/SThFP0iQPAprjNwmTOEucfNholebYmvOwf0PDwkeOlH1SQnTBE5qlaYBxiygNw6LYxxgFFIkWT4oEv2E8mcRZpwlpnGZhjplGaZ7HYR7DKO8T6Mr4lcmqZMbiJCA/npUSC6b/qK1VEg/Dp1qSJ7a7RwN3EDKzkyV5qWXpsibehVGaD3QtpZuivV8biGyXOD6eIw26Ye9elPYc1/ltcEP4NAzcz9XVsCfc/52Bq9uABuFhEoJ+GFq6uBAV19CmfAnQ1AurWWm9y70PfHyHvsvH/4Aew/Y4cs85vFR6hUfJT/D2afiHjHoy73PVbHd6M2EdvSb2ic/efskPB+jpeYh3zJ9YK/T/ooydAV5oAioPAxzqMx4fNw+xWuw39zlv7UxJaPvZavcscu/AH0yN3Qm462vxO1+tlbak1sKjdGxhhTcYlmW8qPH6s7Q0pt/KdHzsOq34hvDq9sJtTErBjEHNSy2as2M+uJuO0f7MtTvN/9mAxnvTmS3Du8+tkFI6HePysqdtp+Ad8n8)

Browser: Chrome Version 120.0.6099.71 (Offizieller Build) (64-Bit)

Operating System: Win11

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.