XpdWiki
Set your name in
UserPreferences Edit this page Referenced by
JSPWiki v2.0.52
![]() ![]() |
Anyone got any tips or suggestions for locating the cause of OutOfMemoryErrors? in Java. - - 'The Situation' - - * Large(ish) Web App with OutOfMemory? Errors reproducable only after several hours of running (or faster under very high load) - * We use a fairly large number of libraries in addition to the standard JDK ones including jaxen and resin amongst others. - - 'Have tried' - - * Reproducing in non-production enviroment / whilst connected to profiling tool. Failed so far! - * -Xhprof style profiling - too slow to use in production enviroment - * Soft referencing various caches. Kinda neat but the caches don't seem guilty. - - We do have a few core dumps I recieved when trying out the IBM 1.4VM but I don't know if there is any simple way of analyzing these. - - Is there any way to actually see what is going on? We've made several 'best guess fixes' such as caching algorithms, xml parsing librarys etc, - - Anyone had any good experiences with tools/techniques for actually discovering the cause of OutOfMemory? Errors - Is remote debugging a machine with a 400Meg OutOfMemory'd VM still running going to help? I haven't tried this yet. MpC Have you tried reproducing it in a non-production environment using greatly reduced amounts of memory? Something like -Xmx32m and a load-testing tool that hits all your pages repeatedly might reveal the problem. --AO To a degree I tried this using WCAT but this was unrealistic and didn't reproduce the problem. I would need some kind of multithreaded/multimachine based apache log replayer to have much of a hope of reproducing a realistic load. Also, it does crash with drastically reduced memory (-Xmx64M) but this is probably not due to the leak. I suspect with the cacheing enabled the app should require about 200MB if hit with a broad range of HTTP requests.--MpC Try somthing like Grinder or Apache's JMeter. They can record someone using your application and then replay that user's actions back with varying levels of load and various random distributions. You can also try using these in combination with GCViewer, profile viewers like HP's (free) JMeter and create an environment where you can quickly trigger the error and record the situation. Links to all of these are available on: http://www.oshineye.com/courses/a11.html You could also try something like the Omniscient Debugger (http://www.lambdacs.com/debugger/debugger.html) if you're really desperate.--AO I'd use a tool like JProbe and look for a count of classes that never gets garbage collected. -- OliBye JMemProf? http://oss.metaparadigm.com/jmemprof/ ![]() http://www.alphaworks.ibm.com/tech/heaproots is from IBM and analyses heap dumps created by certain IBM JVMs. These dumps are typically created on demand or when you've just had an OutOfMemoryError?. The tool is meant to help visualise/analyse the contents of the heap at a precise moment.
|