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

Support for Android version of Total Commander

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

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

Post 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!
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post 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.
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

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

Post 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 ???
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post by *ghisler(Author) »

Didn't you get a warning dialog from Android that the app takes too long to respond?
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 1249
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

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

Post by *AntonyD »

No
#146217 personal license
Post Reply