Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Large files cause crash #1

Open
poleguy opened this issue Nov 27, 2020 · 12 comments
Open

Large files cause crash #1

poleguy opened this issue Nov 27, 2020 · 12 comments
Assignees

Comments

@poleguy
Copy link
Owner

poleguy commented Nov 27, 2020

360mb file crashes file after 10secs of unresponsiveness. See report on giuspen/cherrytree#328

@metal450
Copy link

Tried it with an 18mb file, & it loaded OK (no crash).

@poleguy
Copy link
Owner Author

poleguy commented Nov 27, 2020

I just tried with 40, 80, 150, and 310 MB files. It loaded all but the 310 MB file successfully, and yes, it takes a long time to load with no 'loading' message.

Interestingly, these huge files take a long time to load and save on my PC as well, and also show no loading message.

If anybody is loading files bigger than 300 MB, I'd like to know. Please reply here with the size and type of your biggest files.
I'd like to handle 99% and gracefully fail at the 1% case. I don't know if it makes sense to architect this to handle really large ctb files.

I have not read through the entire cherrytree repo or history, although as I build this app I probably will have to become familiar with a lot more of it.

@metal450 How big is your file on disk as a ctb? I do intend to support that format as well once I am happy with the UI and stability.

My 310 MB file crashed the program. So I should be able to debug and fix this issue. Thank you for reporting.

@poleguy poleguy self-assigned this Nov 27, 2020
@metal450
Copy link

ctb is 273mb. Large files are very common due to how it stores every attachment as stream data within the database itself - so i.e. a few large images or a video attachment or something, and you're there. This is only a problem with ctd though, since ctb is a "proper" database & doesn't require loading the entire file in memory upfront. Pretty sure that's the main reason ctb is default - ctd is prohibitively slow & memory hog due to having to load the entire file preemptively.

@metal450
Copy link

Just curious, i this project no longer under development?

@poleguy
Copy link
Owner Author

poleguy commented Dec 1, 2021

It's not dead, but I'm at a plateau. I'm trying to decide what the next step should be. I could add ctb support next. But even with ctb the architecture of the app right now tries to load the whole file into memory. So if whether I use ctb or ctd, I really should update the code to only load the currently displayed tab.

But then, it works for my very simple case already, and more important to me would be a search feature?

Select/copy text?

Editing? (If editing will eventually be supported, I'd not like to re-create an editor from scratch, so I'm trying to identify a open source editor codebase that I can start from.)

Maybe better support to open ctb files via various sources properly and re-open the last file (ssh/url/local file)... it seems Android is antagonistic to file viewer type apps... or at least there are not great examples I can find on how to do it well.

@metal450
Copy link

metal450 commented Dec 1, 2021

Personally I'd definitely start with CTD first, as that's the default & what most people use (including myself). Followed by incremental loading. Then you've at least got a viewer!

Editing I'd definitely bump till later, as I think having a functional reader first is a much more important step than a reader/writer. And opening from various sources an even lesser priority. Just my 2c. I'd LOVE to be able to just view my notes on my phone, which I presently cannot :)

@poleguy
Copy link
Owner Author

poleguy commented Dec 4, 2021

I did a little search for salute reader with source as a reference. I'm able to open my ctb file with asqlitemanager and read the text. https://f-droid.org/en/packages/dk.andsen.asqlitemanager
I may try to leverage this code. Can you try opening your big ctb on your phone with this viewer? I'd like to know that it works with a big file with real content before pushing forward.

@metal450
Copy link

metal450 commented Dec 5, 2021

I installed that apk & oddly, it crashes the moment I launch it - however, I found the same app on the Play Store (https://play.google.com/store/apps/details?id=dk.andsen.asqlitemanager&hl=en_US&gl=US), & that one works. I can indeed oen my ctb file - opens instantly, & can flip through & see my content in the database :)

@poleguy
Copy link
Owner Author

poleguy commented Jan 3, 2022

Happy New Year. I did a little work and am now successfully compiling the asqlitemanager source on my machine and it runs in the emulator and opens my example ctb. That's a first step toward doing the same in the cherrybud app.

@metal450
Copy link

metal450 commented Jan 3, 2022

Awesome!! Man how amazing it would be to have even read-only access to my notes on the go :D

@poleguy
Copy link
Owner Author

poleguy commented Jan 3, 2022 via email

@metal450
Copy link

metal450 commented Jan 3, 2022

SyncThing is exactly what I use, across Linux, Windows, & Android :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants