Rishabh
Rishabh

Reputation: 3

Getting OutOfMemory exception while working with 8900 blackberry

I have develop one application on blackberry. It is working fine on 8520 and 9000 but when I test it on 8900. Its giving Out Of Memory exception with in some time. I got following message on JDE's debug

OutOfMemoryError
No detail message
net_rim_cldc-6(4A0CB600)
 Bitmap
 <init>
 0x8822

net_rim_cldc-6(4A0CB600)
 Bitmap
 <init>
 0x84A5

net_rim_cldc-7(4A0CB600)
 PNGEncodedImage
 getBitmapImpl
 0x39BD

net_rim_cldc-7(4A0CB600)
 EncodedImage
 getBitmap
 0x10F6

net_rim_cldc-7(4A0CB600)
 EncodedImage
 getBitmap
 0x10CE

Triton-5(4DA2E09E)
 Utility
 resizeAlert
 0x7F9D

Triton-1(4DA2E09E)
 AlertScreen
 paintBackground
 0x938

net_rim_cldc-8(4A0CB600)
 Field
 applyTheme
 0x1071

net_rim_cldc-8(4A0CB600)
 Field
 paintSelf
 0x26F0

net_rim_cldc-8(4A0CB600)
 Manager
 paintSelf
 0x9230

net_rim_cldc-9(4A0CB600)
 Screen
 doPaint0
 0x41D3

net_rim_cldc-9(4A0CB600)
 UiEngineImpl
 <private>
 0xB576

net_rim_cldc-9(4A0CB600)
 UiEngineImpl
 doPainting
 0x93AB

net_rim_cldc-9(4A0CB600)
 UiEngineImpl
 pushModalScreen
 0xA983

net_rim_cldc-9(4A0CB600)
 UiApplication
 pushModalScreen
 0x9089

Triton-1(4DA2E09E)
 AlertScreen
 show
 0x836

Triton-2(4DA2E09E)
 CloseCall
 update
 0xBDF

Triton-5(4DA2E09E)
 Request$4
 run
 0x638B

net_rim_cldc-6(4A0CB600)
 Application
 dispatchInvokeLater
 0xAD1

net_rim_cldc-6(4A0CB600)
 Application
 processNextMessage
 0x127A

net_rim_cldc-6(4A0CB600)
 Application
 enterEventDispatcher
 0xA76

Triton(4DA2E09E)
 TritonClient
 runApp
 0x3800

Triton(4DA2E09E)
 TritonClient
 main
 0x3825

I have used persistent database, threads for HTTP connection. I am not getting exactly why I its coming on 8900 only.

Thanks in advance...

Upvotes: 0

Views: 427

Answers (1)

Vit Khudenko
Vit Khudenko

Reputation: 28418

Does your app use any PNG image resources? Looks like it does and looks like some PNG image is big enough to cause an OutOfMemoryError when a Bitmap instance is being created from the image. My development experience says that it depends on OS version, device model and current device RAM state. So don't be surprised it works on one device and doesn't on another. To prevent the OutOfMemoryError just make sure your Bitmap dimentions is not greater than doubled display dimentions. For instance, if your display is 320x240, then don't use Bitmaps larger than 640x480.

Upvotes: 2

Related Questions