Instead, you can use an ArrayList, but the array should be in order with 10,000 values. Can you post more details? Code, full stack trace, etc. Theoretically, this should be fine with Integer.MAX_VALUE
elements (LOT greater than 10 KB), but of course you may not have memory at first!
In terms of βjust store it in memory and read it from thereβ, well variables are simply stored in memory, so no matter if you use an array or list (or any other data structure), you will always read it from memory!
EDIT: based on your further explanation, this is not a problem with the size of the array at all, it is a problem with the fact that you create 10,000 lines of code to fit in one block, which is too much, and therefore it complains. Modify your code to generate code that uses a loop instead, and everything should be fine, however you have many elements there (before Integer.MAX_VALUE, of course.)
source share