Runtime Error : java.lang.OutOfMemoryError:

Like this :

But I got same error

Did you do the same on your "Main Screen"?

yes I did it all screens , Main Screen :

Remove / turn off all the clocks and test

I removed all the clocks I got the same error. In addition, I tested only page transition for all pages I don't get any error.

OK, you do not say when the error occurs ?

Why are you using a Clock to do a Web.Get request? How did you set the timer interval? It looks like you are overwhelming your device. .You should not do that...

What about asynchronous processing? After having received the result then call Web.Get again without using any clock...

This page describes the principle App Inventor Tutorials and Examples: Webprefetch File by File | Pura Vida Apps

Taifun

I using a clock because I want to read to sheet every 5 second, my esp32 board send data to sheet every 5-6 seconds so I need the latest data

Ok

Please show us an updated screenshot so we can see you diabling the clocks before switching screens

Also let us know

Taifun

Main (Manager Screen) :

Data screen :

Ok, fine
So when exactly does the error occur? Please describe what you are doing and which screens do you visit. . Thr error hapoens after a while on the data screen? Please elaborate

Taifun

After starting the application, I can switch between screens. After 3-4 transitions, I cannot switch. The application crashes. Sometimes the application closes itself automatically, sometimes it does not allow me to press the buttons I use to switch screens, or even if I press it, it does not switch between screens. These usually occur when I am on the data screen. When I tried all the screens one by one, the same error occurred again.

What kind of data are you downloading using the web component?
It is a huge table with 225 columns and how many rows?
And you are using only a small part of that data in the app. .
Probably it is possible to download only that part of data you really need?

Taifun

If you are requesting data from a Google Sheet every 5 seconds, how do you take into account the possibility that it might be taking more than 5 seconds to respond to your request?

This might be a Lucy and Ethel in the Chocolate Factory situation.

1 Like

115 pieces of data come from Esp32 every 5-6 seconds. I write this data into first 115 rows and Esp32 works continuously and the number of columns constantly increases. I save the last incoming data set after the 115th row. The first line contains the data name and the second line contains the data value. I aim to read the data in the 2nd line with the app and show the current data to the user in the mobile application.

Let me suggest you to redesign...
In the data screen each time you get a larger table with more rows and too much unnecessary data... don't do that... simplify and get only the necessary data

Taifun

It's possible in Google Sheets to add extra sheets with summarizations like =MAXIFS() that you can use to reduce your data traffic if you just want to see the most recent data.

Sample app:

how I get specific row and columns in the sheet in app inventor for example I want to read between row 115 and row 230 in column 2.

Look into the documentation
http://ai2.appinventor.mit.edu/reference/components/storage.html#Spreadsheet

Try for example the ReadRange method

Taifun