[Mono-list] exit on out of memory exception

Lluis lmartinez at sct.ictnet.es
Thu Dec 31 15:53:18 EST 2009


On Jueves, 31 de Diciembre de 2009 21:42:37 Bryan Murphy escribió:
> I wish it were that simple.  I've already scanned the code base to try and
> find all the places where we are handling exceptions, but it's a very large
> code base with 3+ years of legacy code in it.  I cannot guarantee that I've
> found every place where we might be swallowing that exception and have
> modified it to handle it appropriately, and was hoping there was an easier
> way to just cut my losses and restart the application.
> 
> When an out of memory exception gets thrown, our whole process is hosed.
> I've been trying to get some profiling information to fix the issue, but it
> happens only in production, rarely, and usually when nobody is looking so I
> haven't made much headway on that yet.
> 
> Bryan
> 
> On Thu, Dec 31, 2009 at 12:58 PM, Lluis <lmartinez at sct.ictnet.es> wrote:
> > On Jueves, 31 de Diciembre de 2009 18:30:22 Bryan Murphy escribió:
> > > Is there a way I can force a mono process to exit immediately when it
> >
> > runs
> >
> > > out of memory instead of throwing an OutOfMemoryException?
> > >
> > > Thanks,
> > > Bryan
> >
> > try
> > {
> > }
> > catch( OutOfMemoryException e)
> > {
> >                your code
> > }
> > --
> > Saludos
> >
> > Lluis
> >
> > _______________________________________________
> > Mono-list maillist  -  Mono-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
> 
Sorry for bad english

Bryan:

Wrap your aplication :

try
{
	yourAplicationMain();
 }
catch( OutOfMemoryException e)
 {
                your debug code
}


-- 
Saludos

Lluis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20091231/6d0be3dd/attachment-0001.bin 


More information about the Mono-list mailing list