欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

Java的内存泄露 Memory leak of Java,

来源: javaer 分享于  点击 8130 次 点评:285

Java的内存泄露 Memory leak of Java,


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.

 

 

相关文章

    暂无相关文章
相关栏目:

用户点评