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: 264
Registered: ‎06-04-2009
My Device: Not Specified

GC getting called by the VM

[ Edited ]

Hi 

I am having an application which shows data stored in a database. The application fetches the data from database and fill a bean class. The application has around 170 pages each page has data taken from database. The pages can be traversed horizontally using arrow button. On each button press new detail screen is pushed with data taken from database. The problem is after using the app for around 10 min the application calls GC(not called by me) and the performance of the application degrades and it becomes really slow that I need to exit it and start it. The GC is called by VM and once it comes the application requires a restart. Anyone faced similar issue ??

Developer
Posts: 19,621
Registered: ‎07-14-2008
My Device: Not Specified

Re: GC getting called by the VM

Your application sounds like it should not cause the phone any stress.  The fact that it does would indicate to me that you are steadily increasing your virtual storage usage.  One thing I would look at is this:

"On each button press new detail screen is pushed "

Are you pushing a new screen and popping the preceding screen?  if you are not popping, you are steadily pushing up your memory usage.  I would investigate this, or look for something similar in your application.

 

If you search the forum for references to the 'profiler' you might find some information about a tool that will help you with this search. 

Developer
Posts: 264
Registered: ‎06-04-2009
My Device: Not Specified

Re: GC getting called by the VM

Hi

On Each button press I am Popping the screen and then only pushing new screen. It's after 10 min of application usage only the GC call starts . Is it because I am doing multiple Sqlite database calls ?
Developer
Posts: 19,621
Registered: ‎07-14-2008
My Device: Not Specified

Re: GC getting called by the VM

I wouldn't have thought so.  I would look at using the profiler and determining what Objects you are using and not freeing firstly.  It could also be that you are just using a load of OBjects, but my experience is that while displaying a screen the GC will kick in and recover objects used by the previous screen.  Is there a chance that you retain a reference to all previous screens used and so they are not freed?

 

Anyway, I would have a look at using the profiler to help you find this.  Search the forum for further information.