【正文】
ce significantly.收集日志:生成HEAP DUMP 分析工具:(IBM Support Assistant)Memory Dump Diagnostic for Java (MDD4J)應(yīng)對(duì)策略:犧牲IO,拆分大對(duì)象為N個(gè)小對(duì)象,以減少對(duì)內(nèi)存的使用。這個(gè)時(shí)候就發(fā)生有內(nèi)存泄漏,時(shí)間長(zhǎng)了,內(nèi)存就被耗光。The Java service team remends that applications avoid the use of finalizers if possible. The JVM specification states that finalizers are for emergency clearup of, for example, hardware resources. The service team remends that you use finalizers for this purpose only. Do not use them to clean up Java software resources or for closedown processing of transactions. Because it will affect the garbage collection, and may cause a memory problem.Finalizers are an expensive use of puter resources and they are not dependable.The Java service team does not remend that you use finalizers for process control or for tidying Java resources. In fact, use finalizers as little as possible.For tidying Java resources, consider the use of a cleanup routine. When you have finished with an object, call the routine to null out all references, deregister listeners, clear out hash tables, and other cleanup operation. Such a routine is far more efficient than using a finalizer and has the useful sidebenefit of speeding up garbage collection. The Garbage Collector does not have so many object references to chase in the next garbage collection cycle.收集日志:生成HEAP DUMP 分析工具:(IBM Support Assistant)Memory Dump Diagnostic for Java (MDD4J)應(yīng)對(duì)策略:使用設(shè)置不再使用的HASHMAP之類(lèi)的變量為NULL,以便垃圾回收器更快回收此類(lèi)對(duì)象。finalize執(zhí)行時(shí)間過(guò)長(zhǎng)(Blocked in Finalize)程序員自己寫(xiě)finalize的處理代碼,導(dǎo)致執(zhí)行時(shí)間過(guò)長(zhǎng),從而影響JVM的高效垃圾回收處理策略。It is remended that users enable the VerobseGC first and the Pmat or GCVM will be helpful to find out the frequent GC.Heap dump tells you the objects info of java heap when it is triggered. You can use Heap dumps to debug the java heap issues. You can press the Tool Generate Dump menu to triger a heap dump which will show objects information. 收集日志:打開(kāi)詳細(xì)垃圾回收,生成HEAP DUMP分析工