sceneform-android icon indicating copy to clipboard operation
sceneform-android copied to clipboard

Out of Memory exception when switching multiple 3D Models in Non AR Sceneform usage case

Open monsterbrain opened this issue 3 years ago • 2 comments

We are using sceneform for showing several animated 3d Models (glb files) in a non AR activity.

We have option for selecting different type of models via menu.

Models are around 7MB to 10MB in range w.r.t size, and contains animations.

On Selecting each model, previously loaded model node will be removed from the arSceneView and new model is loaded and added to scene. After selecting few models app will Crash due to memory exception.

Checking the Profiler, we found that on each model selection, memory keeps on increasing, until it crashes. We tried clearing using the Renderable static function, but keeps crashing. It seems like removing the node doesn't clear the memory allocated for loaded 3d Model. Is there any way to clean up the memory used by the memory model using filament or ar core ?

monsterbrain avatar Mar 08 '22 12:03 monsterbrain

I also meet this problem cause graphics memory can not be released and keep grow which may cause the out of memory crash

chenleicrm avatar Mar 09 '22 08:03 chenleicrm

If you need a more memory friendly usage, you will have to move to SceneView which rely on Lifecycle aware components and on destroy() functions declared on every consuming components. Sceneform memory releasing was originally based on variables references released so you can't really rely on it.

ThomasGorisse avatar Mar 10 '22 12:03 ThomasGorisse

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 16 '23 05:08 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

github-actions[bot] avatar Aug 23 '23 05:08 github-actions[bot]