Search code examples
javawebsphereout-of-memoryibmhttpserver

Websphere outOfMemory exceptions


Earlier this week, there we had Websphere OutOfMemory exception on one of our servers, now my question is, could this have been prevented if IHS was limited in the number of concurrent clients it could sustain. The underlying issue was caused by a database lock, but by the time this got cleared, WebSphere was out of memory.

I was just wondering whether we should limit the number of concurrent client connections in IHS to prevent this error from occurring?

Any help or recommendation would be highly appreciated.


Solution

  • Limiting the number of concurrent sessions would not solve the issue, but work around it.

    If WebSphere ran out of memory, the first thing you should do is grab a heap dump, analyze it and figure out why your application came about to consume the entire heap. I might be missing something, but an application consuming the entire heap due to a database lock implies a bug.

    Limiting the number of concurrent sessions is only a valid solution (rather than a workaround) in cases such as:

    1. Each session occupies X amount of RAM (that is: X is the maximum amount of RAM that a session occupies, assuming the application works as designed), and your heap size is limited to Y. In that case, it makes sense to limit the number of concurrent sessions to Y/X. This is a valid solution (rather than a workaround) because, really, your architecture is not designed to withstand more sessions.
    2. In a complex architecture, the ability of the architecture to withstand a high number of concurrent sessions is as high as the ability of the weakest link. For example, even if you have enough heap size to support 10,000 concurrent users, but your database can only withstand up to 500 concurrent sessions, then you should limit the number of concurrent sessions to 500.