Posted By:
ajay_khatri
Posted On:
Monday, May 17, 2004 12:38 AM
I have a consumer, it receiving messages from a queue in onMessage() method. Every message is processed and stored in a Collection. I'm catching OutOfMemoryError error in onMessage() method but sometime it caught in try-catch block and some time its not the code is like this- public void onMessage(Message msg) { try{ //some processing //hashmap.put(msg,anObject); }catch(OutOfMemoryError err){System.out.println("error"+err);} } Actually i want that every time when there is an OutOfMemoryError condition it should be caught in try-catch block
More>>
I have a consumer, it receiving messages from a queue in onMessage() method. Every message is processed and stored in a Collection. I'm catching OutOfMemoryError error in onMessage() method but sometime it caught in try-catch block and some time its not
the code is like this-
public void onMessage(Message msg)
{
try{
//some processing
//hashmap.put(msg,anObject);
}catch(OutOfMemoryError err){System.out.println("error"+err);}
}
Actually i want that every time when there is an OutOfMemoryError condition it should be caught in try-catch block
<<Less