Avoiding timeout/unresponsiveness with continously running web application


I have designed a web application of which one of the tasks are to monitor the system by capturing the CPU and RAM usage and sending these to a database. I am currently doing this using a separate thread which will capture data during set intervals.

Ideally, my application will be used by our clients to be continuously running over a long duration of time. One of the problems, I have noticed is that after long periods of time (a few hours), the web application times out or becomes unresponsive.

I know by setting the session-time in web.xml, I can avoid the time outs:


Are there any suggestions on how to avoid unresponsiveness?

In terms of design, I realize here there are other options such as creating some sort of daemon to capture the data and send the updates and only have the web application display the charts, but I would like to have everything contained into one web application if possible.


I don’t think it is the “single application” approach you mentioned that causes this.

In some circumstances I’ve been experiencing unresponsiveness at the client side. The browser (at least Firefox) seems to slow down gradually over time. As a page reload typically helps, you can try that first.

If that does not help there probably is something wrong at the server side. For server-side unresponsiveness there are many reasons, so I would suggest to use some Java profiling tools to figure that out.


Thanks for your suggestion. I do prefer the “single application” approach anyways, so if I do continue to experience anymore unresponsiveness, I will try to isolate the problem using some type of Java profiling tools.


Some clarifying questions:

By “unresponsive”, do you mean “slow responding” or “not responding”?

Does it seem like client-side or server-side? That is: is firefox getting sluggish, or is it the application that takes longer and longer to respond?

Best Regards,

Hi Marc,

As far as “unresponsive”, it’s more along the lines of “not responding”. I haven’t had time to do enough thorough testing yet. I may be confusing this issue with an issue in my other post, having to do with concurrent running of the same web application.

What may be happening for me at least, is that I’ll leave my app running for a few hours, I’ll try it and it will work. Then maybe a bit later, I may accidentally open my app in another window (creating a new session) and this causes the original session to corrupt making it unresponsive.

After more testing, I’ll let you know what’s really going on.