java内存泄露,在什么地方最有可能出现内存泄露?
2013-08-13 14:15
435 查看
1 Review static instance and object
All of the classes which implemented a static instance and is invoked as singleton mode are need to be investigated . Especially if it has the static Hashtable,Vector and so on.
2 Review DB connection
DB connection number has increased to an amazing number , and there should be a way to optimize it. It would be a potential memory exhaustion risk.
3 Review Socket Connection
Socket connection numberis increased quickly as Appendix-C. All of the socket connections should beassured to be closed in future. Otherwise it would cause a potential memoryleak.
4 Review File Open
All of the File,BufferReader/Writer, Input/OputputStream should be assured to be closed.
5 Review Thread Invoking
All of the threads shouldnot have a reference from static instance. If not, even the thread is not alive,the thread instance will also not be released.
All of the classes which implemented a static instance and is invoked as singleton mode are need to be investigated . Especially if it has the static Hashtable,Vector and so on.
2 Review DB connection
DB connection number has increased to an amazing number , and there should be a way to optimize it. It would be a potential memory exhaustion risk.
3 Review Socket Connection
Socket connection numberis increased quickly as Appendix-C. All of the socket connections should beassured to be closed in future. Otherwise it would cause a potential memoryleak.
4 Review File Open
All of the File,BufferReader/Writer, Input/OputputStream should be assured to be closed.
5 Review Thread Invoking
All of the threads shouldnot have a reference from static instance. If not, even the thread is not alive,the thread instance will also not be released.
相关文章推荐
- Flex 中可能导致内存泄露的地方
- 关于OC中self是调用属性的存取方法以及它可能出现的内存泄露情况
- 《Thinking in Java 》学习笔记 --- Java内存分配,对象存放到什么地方?怎么放?
- java数据保存在内存的什么地方?
- 什么是Java的内存泄露
- Java会不会出现内存泄露
- Javascript中出现内存泄露的主要原因是什么
- Java中隐藏的this变量和局部变量可能引发的内存泄露问题
- Flex 中可能导致内存泄露的地方
- Effective java2——内存泄露
- Java 中 ThreadLocal 内存泄露的实例分析
- 在web.xml中注册IntrospectorCleanupListener监听器以解决struts等框架可能产生的内存泄露问题
- 可能是最详细的Java内存分析实战
- java内存泄露和调优
- 在liunx下经常出现java.net.SocketException: Too many open files错误是什么原因
- [转] 应聘Java笔试时可能出现问题及其答案(第三部分)
- Java内存泄露问题分析
- java的内存泄露预防
- 有感:应聘Java笔试时可能出现问题及其答案(第二版Part three) (转载)
- ThreadLocal可能引起的内存泄露