Java的内存泄露 Memory leak of Java
2008-10-16 20:18
357 查看
Though GC is the mechanism for memory management for Java, there are some conditions can result in the memory leak.
尽管垃圾收集器负责JAVA内存管理,但是仍然存在一些情况可以导致内存泄露.
For example, if there is a collection, there are collection classes in this collection, there are also collection classes in the second collection classes. If we set the higher lever collection to null, but do not set the inner ones to null values, the GC will not collect the inner classes in time. The longer the system running the memory will be less. What we should do is to set the objects to nulls timely.
Another condition is if we invoke a native method, the method may be written in C/C++, if we allocate some memory but we do not free them, it will result in a memory leak which are not easy to be checked.
尽管垃圾收集器负责JAVA内存管理,但是仍然存在一些情况可以导致内存泄露.
For example, if there is a collection, there are collection classes in this collection, there are also collection classes in the second collection classes. If we set the higher lever collection to null, but do not set the inner ones to null values, the GC will not collect the inner classes in time. The longer the system running the memory will be less. What we should do is to set the objects to nulls timely.
Another condition is if we invoke a native method, the method may be written in C/C++, if we allocate some memory but we do not free them, it will result in a memory leak which are not easy to be checked.
相关文章推荐
- 使用JProfiler分析定位java内存泄露memory leak
- Eclipse、Windows、Linux解决Java内存泄露问题java.lang.OutOfMemoryError
- 内存溢出 out of memory与内存泄露 memory leak
- 内存泄露java.lang.OutOfMemoryError: PermGen space解决方法
- Java 内存泄露 Memory Leak(Oracle官方文档)
- 内存溢出 out of memory和内存泄露memory leak的区别和联系
- 内存泄露java.lang.OutOfMemoryError: PermGen space解决方法
- 内存溢出 out of memory与内存泄露 memory leak
- 内存溢出 out of memory 内存泄露 memory leak ;memory leak会最终会导致out of memory!
- 【Android】【内存】java.lang.OutOfMemoryError 问题分析
- Android 图片内存溢出java.lang.OutOfMemoryError:
- Java中内部类的内存泄露问题
- Java中的HashCode(2)之Hashset造成的内存泄露
- Java内存泄露原因详解
- Java内存泄露的理解与解决(转)
- Java 是否会发生内存泄露
- java.lang.OutOfMemoryError: PermGen space 内存溢出
- java的内存泄露
- 解决Android BitmapOutOfMemory 内存泄露
- 几个关于Java内存泄露方面的问题