JVM - Catch Exceptions
Posted on 2005-03-10
I have written a Java Application using JBuilder. Lately every now and again it is randomly stopping - when it should execute for 5 hours uninterrupted.
I then executed the application from JBuilder in debug mode to understand if any uncaught exceptions are being thrown. I found that the exception
was being thrown. I then used Optimizeit to improve its use of memory and reduced the use from 90MB to 60MB. The application now does not through an error on the development computer. However when I am running it on the production server it continues to stop.
I think this is still the Out Of Memory error as the production server is executing MS SQL which is using 1.5GB of the available 2GB of memory. The server has the following config:
1 Hard Disk partitioned into two C:/ & D:/ with a page file set on C:/ (Max 4GB)
F Drive - RAID Array with no Page File.
2 GB Physical Memory.
My questions are these:
1. How can I catch the exception java.lang.OutOfMemoryError error as it seems to be thrown from JVM and not my code. I would like to confirm that indeed this is the issue on the server (which does not have JBuilder)
2. How can I prevent this issue from happening. I have a page file manually set on C:/ should I got for "System managed Size"???