首页 | 本学科首页   官方微博 | 高级检索  
     

一种基于栈式分配的JVM垃圾收集算法①
引用本文:陈贤闯,徐小良.一种基于栈式分配的JVM垃圾收集算法①[J].计算机系统应用,2010,19(5):74-78.
作者姓名:陈贤闯  徐小良
作者单位:杭州电子科技大学 计算机应用技术 浙江 杭州 310018
基金项目:国家重大专项(2009ZX01039-001-002-004);浙江省重大科技专项(2007C11070)
摘    要:为了减少Java虚拟机垃圾收集器的开销,对Java栈帧进行改造使其支持对象的存储,在此基础上提出一种基于栈式内存分配的垃圾收集算法。算法首先在编译阶段通过对Java源代码进行分析确定栈式分配对象,并用扩展指令标识这些对象,程序运行时它们直接被分配到Java栈上,这些对象在程序离开其作用域时立即被释放,其它对象则分配到堆上,由垃圾收集器进行回收。实验结果表明,与传统基于堆式的垃圾收集算法相比,新算法内存分配和即时回收性能优,占用内存空间少,垃圾回收更及时,减轻了垃圾收集器的负担,提高了运行速度。

关 键 词:java虚拟机  垃圾收集  栈式分配  java栈  对象生命周期

A Stack-Allocation Based JVM Garbage Collection Algorithm
CHEN Xian-Chuang and XU Xiao-Liang.A Stack-Allocation Based JVM Garbage Collection Algorithm[J].Computer Systems& Applications,2010,19(5):74-78.
Authors:CHEN Xian-Chuang and XU Xiao-Liang
Abstract:In order to reduce the cost of java virtual machine garbage collector, we propose a stack-allocation based garbage collection algorithm. We improve the stack frame and make it support object storage, analyse and identify stack-allocation object when compiling the java source code, and mark the object with new byte command. Stack-allocation object will be allocated from java stack and released immediately when leaving its scope. Other object will be allocated from heap and released by garbage collector. Experimental results show that, compared with traditional garbage collector, the new algorithm improves the performance of allocating and releasing, reduces the burden of garbage collector and runs faster.
Keywords:java virtual machine  garbage collection  stack allocation  java stack  object lifetime
点击此处可从《计算机系统应用》浏览原始摘要信息
点击此处可从《计算机系统应用》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号