RAM increases by changing screens, but doesn't decrease by closing screens

Hi,

my app includes three Screens and I use Screen2 for the most things. It is possible to change between Screen2 and Screen3 and back, but everytime, when I change Screens the RAM of my phone increases and doesn’t decrease after changing.

After hours of trying different things and searching in the community, I simplified the problem and used two lables for changing and disabled the “when Screen initalize”-Blocks on both screens, to test, if there is even the same problem and unfortunately, yes, it is.

This is the way, how the app changes (and closes) the Screens:


I read many “tutorials”, like this: App Inventor Tutorials and Examples: Multiple Screens | Pura Vida Apps
But I have no idea what’s going wrong.

There are no Timer which are enabled or anything else which could load something when initalizing Screen2 or Screen3. And as I tested I do nothing else on the screens than clicking on the lable (see on the pictures) to change the screens.

I have 2 GB of RAM in my phone and when I’m starting the app, the RAM is by 54.00% of this 2 GB.
And everytime I switched Screens, the RAM increases (by around 1.00%-2.00%). So, after 10 switches the RAM is by approx. 70.00% and it doesn’t go down. After a while the app crashes completely.

I think it doens’t make sense to show other blocks, because on Screen2 are approximately 17.000 blocks. Maybe this is the problem, but I don’t know why, because almost everthing else works without problems.

I noticed this problem as I got problems with the Notifier. When the RAM goes near to 70.00% or higher the app crashes sometimes (there is no patter), if I want to open a Custom Notifier, but I thing this “problem” is known (App crashes if "notifier" is used to display some error message - #2 by Mika (I have the same android version like the member from this post).

Maybe somebody has an idea what the problem could be :slight_smile: . The size of apk-file is approx. 6.5 MB, so I don’t use images with high solutions or sounds with huge filesizes.

Android: 6.0.1

Thank you very much! :slight_smile:

1 Like

You can used vertical arrangement instead of changing screens.
Or trie use taifun tools extension, inside you found clear cache component, perhaps this helped you
https://puravidaapps.com/tools.php

Edit: Please, read post #5 by Rogerio Rios " How to swich screen correctly "

2 Likes

Thanks! I will think about it :slight_smile:

You’re not closing the screen correctly

2 Likes

There are multiple ways to switch screens correctly and @MrX is using one of those methods.
So this is not because of screen switching.
It will be helpful for us to solve your problem if you will provide an example apk.
@MrX

1 Like

:astonished: I didn’t even know 17,000 blocks in a page were possible.

Yes, switching screens is not the problem here, as @vknow360 already pointed out, but it would certainly help to reduce the number of blocks by using “Any Component" blocks (and 17,000 are really a lot).

Regarding clear cache and RAM, see here:

Thank you very much!

I will try it, to use more of them! Thanks!

Have a nice day :slight_smile: