摘要
为了解决Java3D搭建的三维场景需要占用大量内存空间、容易导致内存溢出的问题,通过分析修改场景后需对场景中不再使用的Java3D对象进行垃圾回收、但Java垃圾回收机制无法直接作用于Java3D对象这一现象,在具体应用中设计了2种有效的方法对Java3D对象进行垃圾回收,分别实现了对整个场景和单个分支的Java3D对象的垃圾回收.实验证明,该方法能够及时释放Java3D对象占用的内存空间,避免内存溢出现象的发生,在一定程度上解决了Java对象垃圾回收不充分的问题.
Three-dimensional scene constructed by Java3D takes up a lot of memory, which may lead to the memory overflow. It is necessary to reclaim the Java3D garbage after modifying the scene. However, the garbage reclaiming mechanism can not directly act on the Java3D object. Thus, two effective methods for garbage reclaiming of Java3D object were designed. The garbage reclaiming of Java3D object for whole scene and single branch is realized respectively. The experiments show that this method can release the memory possessed by Java3D object in time and avoid the memory overflow. The method solves the inadequate garbage reclaiming problem of Java object.
出处
《沈阳工业大学学报》
EI
CAS
2009年第4期450-453,共4页
Journal of Shenyang University of Technology
基金
辽宁省科技厅科技攻关资助项目(2002216008)