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
Contributor
demaniak
Posts: 34
Registered: ‎07-05-2011
My Carrier: Generic

previous instance still active (report to http://go/memoryleaks): previous instance still active

Greetings everybody.

 

I'm getting the error (see subject) fairly consistenly on the 9810 (device), and very intermittently on the 9900 (device).

Note NOT on any simulator (naturually).

 

I have follows some other threads here, with similiar problems - their "solutions" were very much in line with mine, and also not exactly conclusive (for everybody it sorta looked like the problem went away, but nobody was 100% certain of the why's and wherefores, thus could not state with certainty that it was solved.)

 

Can any RIM engineer maybe just list the (exhaustive if possible) potential causes of this very annoying situation?

 

The app does utilize threads (as we must since there is network IO involved), and there are some one shot Timer objects in use.

 

The mentioned threads (3 threads total) are used in a classic producer-consumer situation.

Could there maybe be some deadlock situation arising from waiting on the producer queue object, causing the OS to detect the app as still active?

Somethign else?

 

Looking forward to some illumination....

 

Cheers!

 

Please use plain text.
Developer
simon_hain
Posts: 15,558
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: previous instance still active (report to http://go/memoryleaks): previous instance still active

in my experience this issue is always related to a listener not being removed on program exit, for example because you forgot to de-register it or the application crashed.

check all instances where you add a listener to the system, be it a push listener, filesystem, phone, whatever. some store references to your app as it seems and keep the object from being cleaned properly.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Contributor
demaniak
Posts: 34
Registered: ‎07-05-2011
My Carrier: Generic

Re: previous instance still active (report to http://go/memoryleaks): previous instance still active

[ Edited ]

Hm, ok.

The only system-level listener I'm using is a FileSystemJournalListener.

This is in order to use the native camera app in order to integrate photo's into my app.

 

I verified that I make pretty **bleep** sure the listener is removed after using the camera app (and added again just before the camera app is activated).

 

So by working a bit roughly with the app (activating camera app, exiting app very quickly after taking a photo), I got the BB to throw "net_rim_bb_camera:smileytongue:revious instace still active bla bla you know the rest". FYI, I'm also pretty sure the listener was done procecessing the image, since I got the scaled thumbnail in the image ribbon.

 

Is it possible that "UiApplication.getUiApplication().removeFileSystemJournalListener(...)" runs asynchronously, so that when I hit the exit point of my app, the listener has not been fully removed yet?

Please use plain text.