The moose likes Java in General and the fly likes OutOfMemory error is not being sent to stderr Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "OutOfMemory error is not being sent to stderr" Watch "OutOfMemory error is not being sent to stderr" New topic
Author

OutOfMemory error is not being sent to stderr

thushara wijeratna
Greenhorn

Joined: Jan 28, 2009
Posts: 9
I have an app that doesn't produce OutOfMemory output to stderr. I haven't been able to re-pro this problem on a small app, as if I write a simple app that allocates more than the allowed memory, the JVM catches the OutOfMemory and prints it to stderr.

Has anyone seen OutOfMemory errors being swallowed in some way? The code that exhibits this problem does not catch Throwable, or OutOfMemoryError or such, so I would assume the normal JVM handler should catch it and print to stderr...

thanks,
thushara


http://thushw.blogspot.com
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6321

Describe these two apps. Is app 1 a web app against app 2 being a client app. Web containers may sometimes choose to redirect std out to a file or some other persistence.


SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
thushara wijeratna
Greenhorn

Joined: Jan 28, 2009
Posts: 9
Deepak Bala wrote:Describe these two apps. Is app 1 a web app against app 2 being a client app. Web containers may sometimes choose to redirect std out to a file or some other persistence.

they are both stand-alone apps. the first (more complex app) uses JDO to access a mysql database.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 23178

Thushara,
Could the JDO code itself be catching the error?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Certs: SCEA Part 1, Part 2 & 3 & Core Spring 3
thushara wijeratna
Greenhorn

Joined: Jan 28, 2009
Posts: 9
Jeanne Boyarsky wrote:Thushara,
Could the JDO code itself be catching the error?

except, if i catch Throwable (instead of Exception), i do catch the OutOfMemoryError - this can't happen if the JDO code (which i call) is catching it, right?
 
 
subject: OutOfMemory error is not being sent to stderr
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com