摘要
在 Java语言中 ,内存空间的回收工作是由垃圾收集器 ( Garbage Collector,GC)来完成的。但 GC的工作机制并不完善 ,当一些对象被别的对象引用着而且和根节点有关联时 ,则它们即使是无用的 ,也不能被 GC回收。于是内存渗漏现象就产生了。一些长时间运行Java代码的服务器及本身内存有限的嵌入式系统等可能因为内存渗漏而崩溃。因此 ,程序员在编制 Java程序时 ,应尽力避免内存渗漏现象的出现。除了在编程时予以关注外 ,也可以使用一些有效的检测工具如
In Java language, the recycling memory space is finished by the garbage collector (GC). But the working mechanism of GC is not perfect. As some objects are quoted by others and are related with the root node, they can't be recycled by GC, and even then they are useless. Therefore memory leaks are produced. Some servers running Java code for a long time and the embedded system with limited memory might collapse because of memory leaks. So programmers should do their best to avoid the appearance of memory leaks at the time of working out Java programs. Besides paying close attention to them at the time of programming, we can use some effective measuring tools to find out memory leaks in Java programs.
出处
《浙江工业大学学报》
CAS
2003年第4期405-409,共5页
Journal of Zhejiang University of Technology