Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
New Developer
BBJDev
Posts: 50
Registered: 11-03-2009

OutofMemory error - Global Screen

Hi All,

 

I am developing one BB aplication where Ineed to use Global Screen. My application stops after running for sometime and shows Outof memory error. A have checked the display stack. the count shows 118.

 

My program works with GLOBAL_SHOW_LOWER as like below

 

Ui.getUiEngine().pushGlobalScreen(screen,0,UiEngine.GLOBAL_SHOW_LOWER);

 

what might be the possible cause. how do i empty the stack.  or is it for any other reason.

 

Thanks in advance.

Please use plain text.
Developer
RexDoug
Posts: 4,649
Registered: 07-21-2008

Re: OutofMemory error - Global Screen

Are you closing these global screens?

 

Please use plain text.
New Developer
BBJDev
Posts: 50
Registered: 11-03-2009

Re: OutofMemory error - Global Screen

Hi,

 

No. I am not closing Global screen. the VM is showing as below..

 

VM:HSB4v=27736045
VM:+GC(f)w=12
VM:-GCt=3,b=0,r=0,g=f,w=12
VM:AHSDt=51,i=1,x=18,s=26.4M,q=26.4M,z=15365
VM:+CR
VM:TI2Rv=100
VM:-CR=2
VM:HSB4v=27738109
VM:+GC(f)w=12
VM:-GCt=3,b=0,r=0,g=f,w=12
VM:AHSDt=51,i=1,x=18,s=26.4M,q=26.4M,z=15365
VM:HPEXv=15365
TrialImage
RX=1014.3K,RF=1018.1K,FF=39.9M,OF=396.7K,OS=42.2M,ON=111.2K,OR=0,FR=47.8K,TR=154.9K,RR=0,IS=11.1K
RA=25.8M,RS=23.1M,RN=4.1K
TA=17.6M,TS=17.4M,TN=74.6K
PA=1.6M,PS=1.6M,PN=7.1K
R0=105.7M,1=420.6K,2=24K,3=71.1K,4=2.1M,7=66.2K,8=3K,9=24.7M,10=11.1K,11=27.9K,12=260.7K,13=63K,15=136.3K,20=3.2K,21=524,22=51.8K

 

Thanks,

Please use plain text.
Developer
RexDoug
Posts: 4,649
Registered: 07-21-2008

Re: OutofMemory error - Global Screen

Post the exception stack trace.

 

Please use plain text.
New Developer
BBJDev
Posts: 50
Registered: 11-03-2009

Re: OutofMemory error - Global Screen

VM Stack

0x03896000

 

 

 

 

Please use plain text.
Developer
RexDoug
Posts: 4,649
Registered: 07-21-2008

Re: OutofMemory error - Global Screen

That is not the stack trace. I wonder how you expect to successfully create programs if you cannot perform basic problem determination?

 

Is this on the device or the simulator? If you can duplicate the issue on the simulator, you can view the call stack at the time of the exception. This call stack will show you the sequence of method calls leading yup to the point of the exception.

 

If this is the device, the stack trace must be retrieved from the device event log, or by duplicating the issue while the device is attached to the debugger.

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800901/What_Is_-_A_st...

 

Please use plain text.
New Developer
BBJDev
Posts: 50
Registered: 11-03-2009

Re: OutofMemory error - Global Screen

Sorry, I copied the wrong stack.

 

Stack trace as below..

 

Calling Method                                                                                        Line

Bitmap.Bitmap( int, int, int, byte[], boolean, boolean, boolean )    613

Bitmap.Bitmap( int, int, int, byte[], boolean, boolean )                     441

Bitmap.Bitmap( int, int, int, byte[], boolean )                                      422

Bitmap.Bitmap( int, int )                                                                         358

BackingStore.createBitmap( boolean )                                              130

BackingStore.BackingStore( int, int, boolean )                                   67

GlobalScreenManager.getTransparentBackingStore( )                 1113

Screen.doPaint0( boolean, boolean )                                                1369

UiEngineImpl.paintToBackingStores( )                                             442

UiEngineImpl.doPainting( )                                                                  273

UiEngineImpl.processMessage( Object, Message, boolean )     2442

Application.processNextMessage( Message )                                1835

Application.enterEventDispatcher( )                                                   1079

TrialImage.main( String[] )                                                                    51

 

 

Thanks

Please use plain text.
Developer
RexDoug
Posts: 4,649
Registered: 07-21-2008

Re: OutofMemory error - Global Screen

Nothing jumps out at me - can you post some code where the exception occurs?

 

Please use plain text.
Developer
peter_strange
Posts: 14,611
Registered: 07-14-2008

Re: OutofMemory error - Global Screen

How big is the Bitmap you are creating?

Please use plain text.
New Developer
BBJDev
Posts: 50
Registered: 11-03-2009

Re: OutofMemory error - Global Screen

 

Actually I am trying to display a clock on my homescreen. I am drawing 3 hands of the cloch using bitmap & rotate method. I am able to get them all on my homescreen but when the soconds hand reaches some perticular point, the application throws out of memory error.

 

 

 

UiApplication.getUiApplication().invokeLater(new Runnable(){
     public void run(){
          try{
             TestClockHands screen =new TestClockHands();  
             screen.loadCanvas(count,secVect,minVect,hourVect,index,index1);  
             synchronized(Application.getEventLock()){
                     Ui.getUiEngine().pushGlobalScreen(screen, 0, UiEngine.GLOBAL_SHOW_LOWER);
                     }
            }catch(Exception e){
                                System.out.println(e);
                     }
             }
             });
    

 

 

Please use plain text.