[Bug]: Butterfly permanently freezes after inserting a few strokes in documents that have many pages
What happened?
When editing a document with many pages, Butterfly freezes after making a few edits. If I press in any part of the interface, nothing happens, so I need to close the app and open it again. After opening the document, my changes were saved, but it is annoying to be interrupted while working on a note.
It seems this might be related with how much memory Butterfly uses in documents with many pages. I have sometimes checked memory usage in "Device care" in Android settings while using Butterfly and Butterfly sometimes shows 2GB of memory. I own a Galaxy Tab S6 Lite with 4GB of RAM.
The video below show the aforementioned behavior. I try to use the built-in screen recorder of that tablet, but it crashed while using Butterfly, it seems that both applications: the screen recorder and Butterfly uses too much memory, so I recorded the video from another device. Let me know if you can play the video.
The video below shows that Butterfly permanently freezes after inserting a few strokes in a document that has many pages. The sample content that was inserted was "1 + 2 + 3 ... + 18 + 19 +" (here's where Butterfly froze). I then opened "Device care" in Android settings to check the memory usage. It showed 2GB of free memory. It seems this happened because Butterfly was closed, so there was plenty of free memory, so at the end of the video, when I switch back to Butterfly, it opens the document as if I had opened from the Home menu, instead of showing the page where I recently added the content. For me, this is annoying because it disrupts note taking, since I need to switch back to the page and to the position of the page where I was inserting content.
https://github.com/user-attachments/assets/56e047b9-f413-4230-bccf-122fb5842d86
The video below shows that Butterfly doesn't freeze after inserting many strokes in a new document. The sample content that was inserted was "1 + 2 + 3 + .... + 100". Butterfly didn't freeze while doing this. There's no need to watch the entire video. I just wanted to show that the same version of Butterfly doesn't freeze when inserting many strokes in a new document.
https://github.com/user-attachments/assets/f287344a-5fff-4c74-a5cf-872f7f7f941a
I'm willing to devote some time to collect and share some logs to find the root cause of this issue. Let me know if you need them.
Version
Black Hairstreak 2.4.1
Platform
Android
Relevant log output
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Hello again!
I have yet to reproduce the bug.
but I think having the render to performance and saving set to delayed 10 seconds might help
@rodrigo-morales-1 I am unable to reproduce this issue in 2.4.2 rc0.
Maybe I am doing it wrong.
Please send me the file.
and maybe tell me how to reproduce the bug.
Here is what i did:
- make multiple pages
- draw many strokes in one page
I'm also experiencing this bug, except :
- It also happens on single-page notes with a lot of text.
- It often make the app crash and even causes other opened apps to crash.
@JerryMerweather Here's the file that I showed in the first video of my first message in this thread. I needed to upload it as a *.zip file because it seems that Github doesn't allow sharing files with the *.bfly extension.
triángulos-notables-exactos.zip
You need to follow the steps that I followed in that video:
- Open the document
- Switch to page with name "33-57"
- Write some strokes. Today, I tried to reproduce the bug and Butterfly froze after I draw "1 + 2 + 3 + ... + 17". In the first video in my first comment, Butterfly froze after I draw "1 + 2 + 3 + ... + 19"
I am using "Black Hairstreak 2.4.1"
It did freeze for me. but after doing too many operations, writing then erasing.
But here is the thing, this already happens for me on big documents.
The freezing that happened to you and me is weird. The app doesnt respond to user action, especially the canvas, but the ui reacts visually normally.
After freezing, buttons have the ripple effect after pressing, the tooltips continue to work. but nothing else happens.
This issue ISNT related to the use of pages but rather the amount of strokes I assume. The pages speed up the freezing since they also have strokes, contributing to the total amount of strokes.
as a temporary workaround, disable autosaving and enable delayed autosaving with 10 seconds instead. I assume the issue happens when the app tries to save.
Also divide your notes into multiple documents.
I also get app freezes like yours regularly on a samsung.
Thanks for reporting, I will look at it if I can do something to prvent this freeze