Opening the app in a repo containing a large uncommitted file has gitui quickly consuming all available memory on my system. I have to quit quickly before my system halts.
To Reproduce
place a multi GB file in a repo
open gitui
scroll down and select this file
(optional) scroll away and select another file, notice that memory usage continues to climb
Expected behaviour
It took me a while to notice the issue, as it was taking down my machine before I could play-around, I was assuming it was another cause.
It appears that gitui was trying to present the diff of the new uncommitted file to me. I believe the flame graph below confirms that git_diff_file_content__init_from_src().
Some potential solutions:
Perhaps have a limit on the size of file contents we're willing to present to the user in the diff viewer
or perhaps only present the file content on-focus of the diff viewer (on the right)
Screenshots
Context (please complete the following information):
Fedora Linux 38.20230520.0 (Silverblue)
gitui 0.20.1
Rust version: 1.69.0
Additional context
make profile which produced the following flamegraph:
This issue has been automatically marked as stale because it has not had any activity half a year. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
Describe the bug
Opening the app in a repo containing a large uncommitted file has gitui quickly consuming all available memory on my system. I have to quit quickly before my system halts.
To Reproduce
gitui
Expected behaviour
It took me a while to notice the issue, as it was taking down my machine before I could play-around, I was assuming it was another cause.
It appears that gitui was trying to present the diff of the new uncommitted file to me. I believe the flame graph below confirms that
git_diff_file_content__init_from_src()
.Some potential solutions:
Screenshots![Screenshot from 2023-05-23 08-39-05](https://github.com/extrawurst/gitui/assets/1245553/2d6c9366-fbb1-48c2-b92b-a9d49749d27f)
Context (please complete the following information):
Additional context
make profile
which produced the following flamegraph: