Monitoring each Java web request
Hello,
I am in search for a tool which gives information regarding cpu & memory usage by each url (element) of my live web application.
The tool should be open source and could be configured in production environment.
I want to find out which web request when be executed, outofmemory exception will be faced by my web application.
I'm searching for such a tool from last some days.
I have found jeeobserver which gives me info. regarding cpu usage but information regarding memory usage is not provided.
Any help/suggestion will be appreciated.
Thanks,
Namrata Shah
Re: Monitoring each Java web request
Try obtaining heapdumps (with jmap) every few hours, or once per day over the course of a few hours or days, inspecting them with something like jvisualvm. You'll probably spot the cause of the problem more quickly than I replied to your message. OutOfMemoryErrors (OOMEs) on a web application are most likely either a memory leak (references to defunct objects being held longer than they should - easy to spot and inevitable OOME) or some code or library that occasionally demands a surprisingly large amount of memory (harder to spot and may only occur when several uses of the code or library occur concurrently). Try to obtain a heapdump from your webserver *after* the OOME and before you restart it. That isn't always possible, but you may see the smoking gun.