Page 1 of 1

Which limit is play the main role for the Editor when it opens big file?

Posted: 2023-07-11, 07:59 UTC
by AntonyD
Hi!

My phone literally says that it has on a moment more than 1 GB free memory.
But Total editor - built-in tool - even can't open 5 MB and 3 MB text file! WHY?
What stops it from doing this? Maybe it's time to introduce some 3rd party support lib
even maybe - but to break this unnamed limit borders? I have text files up to 8 MB
and definitely with >1GB free mem they should be easily opened inside the Editor!

Re: Which limit is play the main role for the Editor when it opens big file?

Posted: 2023-07-11, 10:35 UTC
by ghisler(Author)
There is currently an arbitrary limit of 1.5 MB when loading files. The reason is that the loading of data into an Android edit control can only happen in the foreground thread, and takes exponentially longer with files reaching a certain size. Not only the loading takes longer, also the editing becomes incredibly slow once the file reaches a certain size. So while it would be theoretically possible to load an 8MB text file, there is a large possibility that Android would kill the app because of an ANR (Application Not Responding) error because loading the file takes more than 5 seconds, blocking the user interface. It's not possible to load the data in chunks or in a background thread.

Re: Which limit is play the main role for the Editor when it opens big file?

Posted: 2023-07-11, 11:19 UTC
by AntonyD
Right now I found QuickEdit editor = https://play.google.com/store/apps/details?id=com.rhmsoft.edit&hl=en_US
And yes - this editor opened my files. So - this IS possible as we see! And YES - as you said - the loading process was long, but the Android did not kill anyone or anything. I just waited. Although I again do not even find a theoretical justification for these brakes. There is memory for operational use - algorithms for working with text data blocks are quite well known and have long been reliable. And here's HOW it can happen that this file opens more than 8 seconds on average? Is the load subsystem in Android and the edit control objects built-in there - editbox, ?richeditbox? really so stupidly implemented ???

Re: Which limit is play the main role for the Editor when it opens big file?

Posted: 2023-07-12, 09:18 UTC
by ghisler(Author)
Didn't you get a warning dialog from Android that the app takes too long to respond?

Re: Which limit is play the main role for the Editor when it opens big file?

Posted: 2023-07-12, 09:32 UTC
by AntonyD
No