I was recently involved in migrating all applications at my work from Coldfusion7 (running on JRUN with Windows) to Railo (running on JBoss within a Linux environment).
There were several teething issues, as can be expected. Most of them were minor except for one which kept giving us grief. This issue would cause our JBoss instances to drop dead, with a ‘Perm Gen OutOfMemory’ error being logged. After much research I found that this issue relates to the ‘permanent generation space’. (The what?!?).
Apparently, the perm is a storage area of classes that are loaded in the JVM. It seems that the default garbage collection cycle we had configured within our jvm config file did not clear up permanent generation memory. Hence it just kept growing and growing, eventually running out of allocated memory.
This issue is quite common, but finding a cure was quite a pain in the A#@$! All we had to do was add some arguments to the jvm.config file of the application server.
- Add ‘-XX:+UseConcMarkSweepGC’. This is specifing to use the concurrent collector instead of the standard one, which can’t collect in the permanent generation.
- Now add ‘-XX:+CMSPermGenSweepingEnabled’. This tells the collector to collect the perm gen.
- Finally add ‘-XX:+CMSClassUnloadingEnabled’. This tells the collector to allows Java classes to be unloaded.
- Ensure that you give your perm memory a decent allocation by adding the following line in your config file: ‘-XX:MaxPermSize=256m’.
This should, in theory, solve your Perm Gen OutOfMemory error. (Fingers crossed)

Wonderful post, numerous interesting points. I recall five of days ago, I have viewed a similar blog.
Pretty great post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I am going to be subscribing for ones feed and I hope you post again soon.
Thanks for the useful info. It’s so interesting.
Sorry, but I don’t agree with you here. I do not like that approach. But it’s a good start off. Perhaps with some increased information I could manage to understand it healthier?
By the way… hardly awhile back I viewed this exact post on a different website. I have reason to believe someone pinched your article!
@Chiropractor Scranton PA Info : Thanks for your confidence. I’ve always been meaning to start blogging consistently, but never had a chance. Your comments have encouraged me to get serious!
@conveyancing: I’m by no means an expert. What I’ve blogged is what I managed to find out via Google. I am open to the best approach and look forward to more comments from you.
@Seo Techniques: Hmmm…damn buggers! Ah well, I shall take that as a compliment…I must have written something worth pinching