I hosted my web application in windows server.It suffered outofmemoryerror in three days once.Then i restart the tomcat it works fine for next three days and again suffered after three days.I googled for solve this problem,some bodies say to increase the perm-gen space.That only postpones that error to six days.Now six days once my web app generates out of memory error.I also performed code optimization too.For examples
`String s="example";`
It's string literal.Garbage collector does not take literals.so i changed literals to object in all places and reduce some unnecessary code also.But now also i sufferd from the same.
How to prevent permanently from outofmemoryerror?
Any Help Will Be Greatly Appreciated!!