Tim Driven Development | Test until the fear goes away
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Raj Datla wrote:Is there way to avoid out of memory exception programatically?, other than using JVM options "-XX:PermSize" and "-XX:MaxPermSize".
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Jelle Klap wrote:Eek. That is actually not a terrific example, as the substring() method used to copy the entire original char array, which would actually result higher than necessary memory usage. I think that wasn't changed until a minor JDK 7 release, but I may be off the mark a bit there.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
Raj Datla wrote:Is there way to avoid out of memory exception programatically?, other than using JVM options "-XX:PermSize" and "-XX:MaxPermSize".
As Jelle said: No. And tweaking those parameters is treating the symptom, not the cause. It may buy you a bit of time, but it will almost never solve the problem. Indeed, OOME is itself a symptom - usually of badly-written code.