• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Server restarting - Out of Memory Exception

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

We are using Websphere 5.1 and after our recent production deployment, server is restarting every 3-4 hrs. I am able to see some OutOfMemory and stack overflow exception.

Is there a way I can find out what piece of code is causing the problem and any tips for not getting in this problem in the future...

Thanks in advance...

Karan
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are a lot of things that can cause out of memory errors. If you notice that a particular operation, like a database query or file load, causes it, you may be trying to load too much data in the virtual machine. You can either increase the VM's size or process the data in smaller pieces.
If the problem is more intermittent, it may be caused by not freeing up resources correctly. Any file, socket, database connection or other resource must be freed by invoking close(). This must be done in the finally block of a try-catch-finally structure to make sure close() is invoked.
If the cause is not obvious, you are probably accumulating data somewhere and never freeing it. HashMap/Table can have this problem if your objects don't implement hashcode correctly. The JVM has some tools to help you monitor the VM: Monitoring and Managing Java SE 6 Applications.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apart from Joe said, the other potential area is executing a block of code infinitly. Pls look at the loops and recursive function calls in the code. If this is happening after a recent production code release, concentrate on the release code changes.
[ April 15, 2008: Message edited by: Gurunath Policherla ]
 
Joe Ess
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gurunath Policherla:
the other potential area is executing a block of code infinitly. Pls look at the loops and recursive function calls in the code.



I would think that circumstance would cause a StackOverflowError rather than an OutOfMemoryError
In any case, please don't Wake The Zombies. I don't think Karan's been quietly watching this topic for 2 months waiting for more input.
 
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic