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

Trusted Contributor
Posts: 145
Registered: ‎01-23-2012
My Device: 9300
My Carrier: airtel

popScreen() is releasing Memory or not

Hi All,


        While calling popScreen() , is it variable also remove from memory. Any one have any idea about this? For eg:

I created a class, in that i using many variables, in this class object i passing to pushScreen(), after this screen use i calling popScreen(). But manytimes i will go inside the screen iam getting stuck that means clock sympol is coming in the device. So how i can handle the memory in blackberry.





Posts: 16,984
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: popScreen() is releasing Memory or not

java has garbage collection. if an object does no longer have any references it is cleaned.

if you show your screen like
pushScreen(new LalaScreen());
you don't save any reference, and if you call pop the screen object is garbage.

if you want to retain it you could save a reference to it somewhere, in a class variable etc.
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