Repository navigation
Restart the mail viewer's process when nothing is on screen - #297
Merged
Merged
Conversation
… minutes The process keeps what pictures took after the page is gone, and only ending it returns that memory. A conversation open in an unseen pane or window is drawn again at once.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The web process that draws mail keeps what pictures took after a page is gone. It settles at 500 to 600 MB after an hour of reading and never goes lower. Clearing the page, clearing WebKit's memory cache and waiting do not free it. Ending the process does, and a new one starts near 110 MB.
This ends the process when nothing it draws is on screen, so the memory comes back while the person is away.
The rule
The process is ended with
terminate_web_process. WebKit reports it through the same signal as a lost process. The conversation view already handled that signal by forgetting what the page held. It now also draws the open conversation again when the page had finished parsing before the process went. A page that died while loading is not redrawn, so a crash on load cannot loop.The 48 MB inline picture cache is unchanged.
Numbers
Same scripted session as the memory investigation: 100 conversations opened with the Down key, then a pause (3000 messages, Dovecot, headless). Web process PSS:
Without the change the process stays where it is: a run of the same session on the build with no restart, with the window in use and then idle for 5.5 minutes, sat at 565 MB the whole time (593 MB right after the opens). The unseen-window case was driven with a test hook that reports every view as unseen. Xvfb has no window manager, so the real minimized and hidden checks were not run.
Time from
load_htmlto the page's finished event, 132 loads in one session: median 52 ms, mean 67 ms. The first load in a fresh process took about 300 ms (303 and 312 ms), and the conversation drawn again after a restart took 312 ms. The person sees the conversation again at its top, as for any fresh open. I read screenshots of both cases (conversation open in the unseen window, and the first conversation after the empty pane) in dark mode; each shows the message normally, with no crash page.Checks
cargo clippy --all-targets -- -D warningsis clean.