• 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

OutOfMemoryError

 
Ranch Hand
Posts: 838
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
One of the people using a jsp application I've created is getting a OutOfMemoryError on their AIX machine. I can't replicate it on our Windows machine BUT, here's the thing. Thye have only recently starting getting this error. It appears to happen randomly across different pages of the application ruling out possible infinite loops and such. I'm using RedBack as the servlet container if that helps. I'm not too familar with how the JVM heap works and etc.., but, going by the information stated here, can anyone offer some suggestions on how to fix this and some explanation why I should do it? Once a browser window is closed does the session objects contents get garbage collected? Thanks so much for any help.

Rob
 
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

Once a browser window is closed does the session objects contents get garbage collected?


Once a session is invalidated, all of the references it contains are released - whether or not the objects are GCed depends on if there are any other references. Sessions get invalidated by:
1. Your program specifically calling invalidate()
- or -
2. The servlet container timing out the session and calling invalidate.

Possibly the AIX machine is just getting more traffic or does not have enough memory assigned to the servlet container. The command line parameters to assign memory to a JVM are covered in the tooldocs section of the Java docs.
Bill
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Out of Memory Error will occur because of using some for loops,while loops where it almost reaches to Infinite.

Check the conditions
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can set ms & mx options while server startup in startup.bat or similar file as a java option

java -X ms 512Mb mx 512Mb or something similar

Shriniwas
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rob Pike ,
we had the same problem but the other way around . We got in all our MS servers and not in other machines .The reason was due to some patch MS provided for some other issue .

since the systems are same , ask you client whether they have applied any patch recently .
 
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rob Pike:
I'm using RedBack as the servlet container



Are you using "RedBack" or Websphere/Tomcat/Resin/etc as your servlet container?

As I understood it, RedBack was simply a web object used to access certain databases (IBM brand, if I recall correctly).
 
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've also had that problem with applications that accept file uploads, not sure if this is your case. But if it is it helps to make sure you clear the session and specify max file sizes.
reply
    Bookmark Topic Watch Topic
  • New Topic