Debug Java Out Of Memory Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site out of memory error java lang outofmemoryerror nokia About Us Learn more about Stack Overflow the company Business Learn more about out of memory error java lang outofmemoryerror nokia c3 hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join jmap permstat the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to debug Java java outofmemoryerror java heap space OutOfMemory exceptions? up vote 9 down vote favorite 1 What is the best way to debug java.lang.OutOfMemoryError exceptions? When this happens to our application, our app server (Weblogic) generates a heap dump file. Should we use the heap dump file? Should we generate a Java thread dump? What exactly is the difference? Update: What is the best way to generate thread dumps? Is kill -3 (our
Java Default Heap Size
app runs on Solaris) the best way to kill the app and generate a thread dump? Is there a way to generate the thread dump but not kill the app? java out-of-memory coredump java1.4 thread-dump share|improve this question edited Dec 22 '10 at 18:13 asked Dec 22 '10 at 18:01 Marcus Leon 17.2k72203327 1 Do you mean it generates a .hprof file, or something else? –skaffman Dec 22 '10 at 18:03 A heapdump in phd format –Marcus Leon Dec 22 '10 at 18:05 add a comment| 7 Answers 7 active oldest votes up vote 3 down vote I've had success using a combination of Eclipse Memory Analyzer (MAT) and Java Visual VM to analyze heap dumps. MAT has some reports that you can run that give you a general idea of where to focus your efforts within your code. VisualVM has a better interface (in my opinion) for actually inspecting the contents of the various objects that you are interested in examining. It has a filter where you can have it display all instances of a particular class and see where they are referenced and what they reference themselves. It
space 3.1.2 Detail Message: PermGen space 3.1.3 Detail Message: Requested array size exceeds VM limit 3.1.4 Detail Message: request
Heapdumponoutofmemoryerror
This Site Careers Other all forums Forum: Performance OutOfMemoryError : Suggestions for debugging Priyanka Dandekar Ranch Hand Posts: 52 posted 7 years ago I am trying to debug an OutOfMemoryError we are getting on Web application which is based on Spring Web flow + Hibernate + https://coderanch.com/t/427757/Performance/java/OutOfMemoryError-Suggestions-debugging c3p0 connection pool. I am using Jmeter to simulate the load of 5 concurrent users on this system and withing 5 minutes the applications runs out of memory with below message. java.lang.OutOfMemoryError: Java heap space Exception in thread "http-8080-3" java.lang.OutOfMemoryError: Java heap space The applications is not doing much processing so I assume so much memory is not required for it. I am using JProfiler to do application profiling, but I am kind of new to it out of so may be any suggestions on a good profiling tool are also welcome. Looking at the object allocations I see there are too many objects of java.util.concurrent.ConcurrentHashMap and its inner classes. See the attached image with JProfiler report. Let me know what could be the possible reason for this. I am open to any ideas you have. On Production we are running this application with 1.5GB JAva Heap space and it runs out of memory within 2-3 days. out of memory profiling.JPG JProfiler output snapshot for all objects Priya - Mockup Tool | Java | Struts2 | Lucene rajesh bala Ranch Hand Posts: 66 posted 7 years ago Can you post what is the heap size you used in your server? Definitely concurrenthashmap came up at top. But looking at the size it occupies, it doesn't seem to be a major issue. ~Rajesh.B Joe Ess Bartender Posts: 9321 10 I like... posted 7 years ago Here is an article on memory leaks, their causes and how to resolve them. [How To Ask Questions On JavaRanch] Priyanka Dandekar Ranch Hand Posts: 52 posted 7 years ago Thanks for your replies, I figured out the issue. There was a place where a call to findAll method was made on a hibernate entity. This was bringing whole database in memory and we were running out. I have removed this piece and it works now. Thanks again for your responses. Priya - Mockup Tool | Java | Struts2 | Lucene Priyanka Dandekar Ranch Hand Posts: 52 posted 7 years ago for benefit of others, here are the consolidated list of commands which can help you debug similar issue Debugging java OutOfMemory issue Priya - Mockup Tool | Java | Struts2 | Lucene It is sorta covered in the JavaRanch Style Guide. Post Reply Bookmark Topic Watch Topic New Topic Similar Thread