• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

string.trim() causing outofmemoryerror?

 
Ranch Hand
Posts: 33
Android Mac PPC Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,

we are facing outofmemory in production environment with jboss. we allocated 2 GB. we are having some owkward issue.
when this error comes up specific functionality doesn't work. but still users are able to access different functionality.
we noticed that when we have nullpointer exception in string.trim() or patter.compile() at this time we are getting outofmemoryerror.

if one user get outofmemoryerror other can still try with different functionality.

is there any possibility that string.trim for null value cause this error???

please help
thanks
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, there are too many unknowns to be sure, but it seems to me like the problem may come from your error reporting. The only way to be sure would be to profile the application and see what is consuming so much memory.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

is there any possibility that string.trim for null value cause this error?



Trying to execute trim() on a String reference that is actually null will of course cause a NullPointerException which would only consume memory to build the stack trace. Not a very large amount of memory involved, look elsewhere.

Bill

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic