I ask for help and forgiveness if the question is stupid. But I ran into a problem.
I am from Ukraine and my English is bad, so I am writing through a translator, do not hit for errors, please)
The essence of the problem:
I wrote the program. Was at the stage of loading the necessary files and saw that a memory error occurs.
I began to understand the problem and this is what I came up with:
IF ATTACHING MORE THAN 204 FILES THAT IS THE CLOSING OF A SKETCH AND A ERROR:
a.lang.OutOfMemoryError: Failed to allocate a 1280012 byte allocation with 648856 free bytes and 633KB until OOM
How did I come to the number 204? I created a stress test. I attached pictures many times and fixed the number and total weight of the added files.
Initially I thought that it was a matter of weight, but practice showed that the weight could be 130 megabytes and 76 and 35 megabytes. I checked it on three files of different weights. So it’s not about weight?
HERE IS THE STRESS TEST CODE:
PImagetwis=new PImage ;
PImagetest=new PImage ;
text("Прогрузилось "+stage, 100,100);
text("ВЕС mb "+mb, 100,150);}
And yes, the problem initially arose when I attached the files I needed to the main sketch. They were drawn in the program as the files for the test.
But Processing did not want to attach more than 30 pieces. I do not know what the matter is, because I replaced these pictures with something else and everything worked again up to 204 files. Maybe this is some kind of anomaly, I do not know))
But now the main question is 204 files.
Is this a limitation or what? I need more files)) And yes, I write on android.