I checked all variants and this is the resume:
In order to elaborate huge strings (byte by byte) or huge lists (element by element) without STACK ERROR or the application crash its necessary to divide this string/list in small pieces using Clock timer.
The extraction of each piece can be done by:
- SLICE LIST block that is very fast but already after 50K elements it produces a stack error
- SEGMENT TEXT block that is much slower but it works up to 2-2,5 mln elements
- Javascript string SLICE() method that is a little bit faster than SEGMENT TEXT and i was not able to find a limit of elements (i was using Webviewer for JS execution from AI2)
Using JS the elaboration of 3 MB file is taking about 20 minutes on my Oneplus with 16MB of memory that is suitable for my task.
Thanks to TIMAI2 and ABG for the help!