简体   繁体   English

应用程序导致内存泄漏

[英]Application leads to memory leak

Currently working in smartGWT project where it consumes a lot of memory when the application performs any CRUD or Grid loading and refreshing operations and the application deployed in tomcat server 7.0 . 当前在smartGWT项目中工作,在该项目中,当应用程序执行任何CRUD或Grid加载和刷新操作以及将应用程序部署在tomcat服务器7.0中时,它将消耗大量内存。 I have tried thread specification and Memory restriction in tomcat but it won't works.Could you please suggest way to avoid memory leak. 我已经在tomcat中尝试了线程规范和内存限制,但是它不起作用。请您提出避免内存泄漏的方法。 awaiting for your reply. 等待您的回复。

In order to avoid memory leak. 为了避免内存泄漏。 We should get information on the objects allocated on the application. 我们应该获得有关在应用程序上分配的对象的信息。 If you are using IBM JDK then JVM will collect javacore, system core and snaptrace when JVM throws OutOfMemory. 如果您使用的是IBM JDK,则当JVM抛出OutOfMemory时,JVM将收集javacore,系统核心和snaptrace。 Until System throws OOM we will not get clear picture on object allocation and de allocation pattern. 在System抛出OOM之前,我们将无法清楚了解对象分配和取消分配模式。

For Example: if you take systemcore in middle of the application run time. 例如:如果您将systemcore放在应用程序运行时间的中间。 There are possibilities that GC yet to run to clean dead objects so the current snapshot may not give the full picture of the application allocation. GC有可能无法运行以清除死对象,因此当前快照可能无法提供应用程序分配的全部情况。 When JVM throws OOM it means GC kicked on and all possible collection of dead objects are taken care so analyzing the existing objects in the heap will reflect the true information on the java heap. 当JVM抛出OOM时,这意味着将启动GC并小心所有可能的死对象集合,因此分析堆中的现有对象将在Java堆上反映真实信息。

Once you collect logs load the system core in Memory Analyzer tool. 收集日志后,请在“内存分析器”工具中加载系统核心。 https://www.ibm.com/developerworks/java/jdk/tools/memoryanalyzer/ It will help you in identifying leaks. https://www.ibm.com/developerworks/java/jdk/tools/memoryanalyzer/这将帮助您识别泄漏。

If you using Oracle JDK please follow http://www.oracle.com/technetwork/java/javase/memleaks-137499.html 如果您使用Oracle JDK,请遵循http://www.oracle.com/technetwork/java/javase/memleaks-137499.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM