Linked by Thom Holwerda on Fri 14th Sep 2012 02:30 UTC, submitted by MOS6510
Java "As a typical Java developer I never monitored the memory usage of my application apart from following typical best practices like closing the connections, streams etc. Recently we were struck with few issues in our JBoss servers that I had to dig in to the memory management."
Permalink for comment 535088
To read all comments associated with this story, please click here.
RE[2]: Memory management
by raboof on Fri 14th Sep 2012 17:39 UTC in reply to "RE: Memory management"
raboof
Member since:
2005-07-24

Our 'architects' have been looking into this for what seems like years, analyzing heap dumps and what not, and they usually just give the apps more permgen space, which fixes the problem ... for awhile, anyway.

For permgen space errors, indeed usually increasing it is the way to go. The permanent generation is used for 'static' information (using the word loosely, and apart from some exceptions which are unlikely to be relevant). It is expected to grow a bit after startup, up to the point where everything relevant for your application is loaded and the usage will no longer rise, no matter how much load/data you throw at the system.

If this is an application running inside a servlet container: do you ever restart/upgrade a component/application in the container without restarting the container, too? This is possible, but avoiding memory leaks (even in permgen, as each instance will have its own classloader) is tricky, and it's often acceptable to just restart the entire container.

For heap space errors, yeah, you need a developer to look at those.

You mention 'architects'. In case of memory errors (both permgen and heap), I'd suspect a programming error rather than an architecture error first. I'd suggest having a good developer ('craftsman' seems to be the hip term these days) look at it. He should be able to pinpoint what's the biggest culprit, and from there you can see whether it is possible to fix within the current architecture or that you really need structural changes.

Reply Parent Score: 4