Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in graphics #34

Closed
Miao-10k opened this issue Apr 15, 2021 · 7 comments
Closed

Memory leak in graphics #34

Miao-10k opened this issue Apr 15, 2021 · 7 comments

Comments

@Miao-10k
Copy link

Miao-10k commented Apr 15, 2021

I am running the gltf sample with a customized model. It seems that the graphics memory is not released after the MainActivity destroyed which can be seen from the profiler. This may lead to out of memory if I start and then destroy the activity several times.
As mentioned in the issue I opened in filament, I tried to fix this memory problem by adding Renderer.destroyAllResources() at the end of onDestroy() of BaseArFragment, which will lead to a crash in the function RenderableInstance.createFilamentAssetModelInstance when I start the activity again. Do you have any idea about solving the memory problem or why this crash happens after the filament engine destroyed?
image

@ThomasGorisse
Copy link
Collaborator

Can you clone the repo, try to fix it and make a pull request or put the solution here ?

@ThomasGorisse
Copy link
Collaborator

Hi @Miao-10k,

Can you try the latest version to check if it brings fixes to your memory leaks ?

Thanks

@steven-gao
Copy link

@Miao-10k i met as same crash as you ,i do as you do to release memory use "Renderer.destroyAllResources()" function.
Did you solve that problem
thank for your time

@steven-gao
Copy link

@ThomasGorisse i use 1.18.11 version,memory is released after activity destory.
thank you very much.

@steven-gao
Copy link

@ThomasGorisse could you tell me how do you release memory ?

@ThomasGorisse
Copy link
Collaborator

You can call the SceneView.reclaimReleasedResources().
It will release rendering resources ready for garbage collection.

@steven-gao
Copy link

steven-gao commented Jun 2, 2021

You can call the SceneView.reclaimReleasedResources().
It will release rendering resources ready for garbage collection.

but in your demo ,i'm not found where to call SceneView.reclaimReleasedResources(),i still not understand how do you release your memory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants