简体   繁体   中英

How to clean up FinalizerReference instances created by rajawali LoaderObj.parse()?

I'm new to rajawali. I have and 570 frames animation from Blender and exported into obj and mtl files (570 each). I tried to write an android rajawali app to display the animation by the LoaderOBj object. I wrote a loop to display and hide each obj one by one. I found memory leaking issues.

After troubleshooting with heap dump and allocation tracking, I found the parse() method of LoaderObj creates lots of FinalizerReference instances. There is no reset() or equivalent method under LoaderObj. How can I solve this memory leaking or I'm wrong to use a loop to display the 570 frames of obj/mtl files?

You never "clean up" instances of the FinalizerReference class, whether created (indirectly) by rajawali, or in any other way. They may be removed by the system during garbage collection, in which they play a crucial role for classes overriding the finalize() method of the Object class.

It is likely that FinalizerReference attracted your attention for the wrong reasons. It often shows up close to the top of a heap dump, due to the spuriously large value reported by Android Memory Profiler for its Retained Size. I have investigated this, and found that such large values of Retained Size are due to massive multiple counting by the Profiler of the same small amount of memory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM