Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 209
Registered: ‎11-08-2008
My Device: Not Specified

uncaught exception : out of memory

sometimes my application throws "out of memory exception". It may be because of improper handling of threads or data.

So please tell me what makes an application to throw this exception ?

And from where can i get the cpu usage and memory information on blacberry device or simulator ?

 

 

thanks and regards

Mudassir

Thanks and Regards
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: uncaught exception : out of memory

Take a look at classes

 

net.rim.device.api.system.MemoryStats
net.rim.device.api.system.EventLogger

 

MemoryStats gives information about the free and allocated memory.

EventLogger helps to log events to device log.

 

To open device log (works also on simulator) - hold Alt key and click LGLG on the device keyboard

 

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: uncaught exception : out of memory

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: uncaught exception : out of memory

When you run your app from JDE use menu:

 

View - Objects

View - Memory statistics

Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: uncaught exception : out of memory

Apparently if you catch Throwable or Error you can keep running and take some

steps to figure it out. Presumably you will find either a request for a big block do to a size

calculation error or a loop that creates lots of small stuff with dangling references. In either case,

it apparently is not JVM specific.

 

IIRC, in the past on other computers, I have found this is not always a literal memory problem and could be thrown

due to depletion of other resources.