This week's book giveaway is in the Flex forum.
We're giving away four copies of Flex 4 in Action and have Tariq Ahmed, Dan Orlando, John C. Bland II & Joel Hooks on-line!
See this thread for details.
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Win a copy of Flex 4 in Action this week in the Flex forum!
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Java in General
 
RSS feed
 
New topic
Author

OutOfMemory error is not being sent to stderr

thushara wijeratna
Greenhorn

Joined: Jan 28, 2009
Messages: 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
Messages: 4859

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
Messages: 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.

http://thushw.blogspot.com
Jeanne Boyarsky
internet detective
Sheriff

Joined: May 26, 2003
Messages: 17147

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

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]

"The set strikes me as something like the set of potatoes, radishes, farming, and lunch. " - a colleague's way of comparing both overlapping and disparate groups. made me laugh and thought of the ranch
thushara wijeratna
Greenhorn

Joined: Jan 28, 2009
Messages: 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?

http://thushw.blogspot.com
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Java in General
 
RSS feed
 
New topic
IntelliJ open source

.