Re: Exception handler problem.



Hi Andrew,
1) There is no memory leak in this program. My user just tries to load
too many information from the database and it is not easy to estimate
the memory required to store and to show data on the screen. I usually
show a message "This query may be too long ..." to my user before
retrieving data, but it is up to he/she to start an execution. This is
the reason why I have this problem.
2) I already created an invisible error message box and I am going to
make it visible if error detected.
Regards,
Serguei.

andrewthommo@xxxxxxxxx wrote:
Serguei.Goumeniouk@xxxxxxx wrote:
Dear Experts,
My GUI application sometimes runs out of memory with the message like
the following:

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java
heap space

I try to catch this exception with:
1) The Thread.UncaughtExceptionHandler
2) try / catch block "around" my main class
but both attempts do not work.

Is there a simple way to catch exceptions in AWT thread?

An exception in another thread is harder to catch .
But that is not an Exception, it is an Error, what are you 'catch'ing?

Sun distinguishes between them because errors are more serious.
In fact, your options are very few if you do manage to catch it.
After all, there is no more memory to instatiate new objects
(such as a warning dialog).

Also, it is important to track down the cause of this error
and fix it, as the program probably has a memory leak.

Andrew T.

.



Relevant Pages

  • RE: GC memory pressure problem in using unmanaged components
    ... There is a probablity of memory leak but i dont think ... that the given exception is a result of memory leak. ... Int32 height, String& ext) ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to troubleshoot bugchecks on my own?
    ... not a memory problem. ... From that exception record and context, ... execute the instruction - without a problem. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Strange sudden shutdown issue with CF app
    ... Phone devices are notoriously low on virtual memory right out of the box because the OEMs decide to put every little thing into its own DLL and then have 25 processes launched at boot. ... Chris Tacke, Embedded MVP ... We have created an app that basically connects to a web service gets data, then stores it locally on the device, and when a record needs to be modified/added the system first tries to connect the web server sees if its availible, if not then it stores in locally on the device until the connection comes back, now I noticed that if the device does not mess around with the data connection then the application sits nicely as long as its open, and never gets shut down. ... But again most of the time I get no exception at all but just simply disappears. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: error wince600 boot message after dowload PB6 OS to HW board
    ... I would suspect that you have a memory layout problem, either the bootloader is using memory that is clobbering the downloaded image in some way, or the memory layout in the config.bib is wrong. ... Old or invalid version stamp in kernel structures - starting clean! ... Exception 'Access Violation': Thread-Id=00410002, ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Strange sudden shutdown issue with CF app
    ... Phone devices are notoriously low on virtual memory right out of the box because the OEMs decide to put every little thing into its own DLL and then have 25 processes launched at boot. ... Chris Tacke, Embedded MVP ... We have created an app that basically connects to a web service gets data, then stores it locally on the device, and when a record needs to be modified/added the system first tries to connect the web server sees if its availible, if not then it stores in locally on the device until the connection comes back, now I noticed that if the device does not mess around with the data connection then the application sits nicely as long as its open, and never gets shut down. ... But again most of the time I get no exception at all but just simply disappears. ...
    (microsoft.public.dotnet.framework.compactframework)