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
Trusted Contributor
user17
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.

 

 

 

Thanks

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
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
Please use plain text.