简体   繁体   English

如何清理rajawali LoaderObj.parse()创建的FinalizerReference实例?

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

I'm new to rajawali. 我是rajawali的新手。 I have and 570 frames animation from Blender and exported into obj and mtl files (570 each). 我有来自Blender的570帧动画,并导出到obj和mtl文件(每个570)。 I tried to write an android rajawali app to display the animation by the LoaderOBj object. 我试着写一个android rajawali应用程序来显示LoaderOBj对象的动画。 I wrote a loop to display and hide each obj one by one. 我写了一个循环来逐个显示和隐藏每个obj。 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. 在使用堆转储和分配跟踪进行故障排除后,我发现LoaderObj的parse()方法会创建大量的FinalizerReference实例。 There is no reset() or equivalent method under LoaderObj. LoaderObj下没有reset()或等效方法。 How can I solve this memory leaking or I'm wrong to use a loop to display the 570 frames of obj/mtl files? 如何解决这个内存泄漏问题或者使用循环来显示570帧的obj / mtl文件我错了?

You never "clean up" instances of the FinalizerReference class, whether created (indirectly) by rajawali, or in any other way. 您永远不会“清理”FinalizerReference类的实例,无论是由rajawali创建(间接)还是以任何其他方式创建。 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. 它们可能在垃圾收集期间被系统删除,在这些类中,它们对于覆盖Object类的finalize()方法的类起着至关重要的作用。

It is likely that FinalizerReference attracted your attention for the wrong reasons. FinalizerReference很可能因错误的原因引起了你的注意。 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. 它经常显示在堆转储的顶部附近,因为Android Memory Profiler报告了其保留大小的虚假值。 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. 我对此进行了调查 ,发现保留大小这么大的值是由于Profiler对相同的少量内存进行了大量的多次计数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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