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
TST bloats Firefox session store file #1907
Comments
I currently have 11 000 tabs open, sessionstore.lz4json is just 5 mb in size. I guess that's because I disabled caching in TST settings. |
Due to some reasons, now TST stores caches of the window to the last tab. So, if you open new last tab and close it again and again, stored tab data for the "undo close tab" command will be increased... |
@piroor, you should consider using the |
I've regularly experienced Firefox refusing to load my session file, until I spent several hours today nailing down the problem to this very issue. @tobbez's detailed explanations were a life saver: thanks very much ! After stripping TST's cache metadata from my session file, Firefox loaded it flawlessly. Also the size of my recovery.jsonlz4 file went from 42 Mb down to 9.5 Mb. I'm also suspecting that this bloating of my session data was the reason why Firefox's memory footprint was periodically increasing and decreasing when backing up the session file, triggering the Linux kernel's out-of-memory killer on a daily basis. I cannot but hope that a solution is found to this problem, making these bitter experiences a thing of the past. Meanwhile, I'm disabling caching in TST settings. Could we have an explanation about the consequences of disabling caching ? In any case, I wish to take the opportunity to thank @piroor once again for his continuous efforts in maintaining TST. Cheers ! |
I've introduced some changes around the cache system. TST now tries to clear cache data of non-last tabs if possible. Due to WebExtensions's restriction, TST cannot clear cache data of already removed tabs notified via |
Thanks for these changes ! Will the cache be cleared when using Ctrl-w to close tabs ? |
@ngirard Sadly no, Ctrl-W case is not handled for now. Ctrl-W is handled by Firefox itself, and Firefox just reports an event indicating the tab is removed, and TST cannot clear cache data for the tab. (Even if TST tries do that, WebExtensions API just returns an error like "the tab is not exist".) |
Thanks for your explanations. It looks like a tricky situation... |
@piroor is there anything more that can be done at this point or is this a "bug of Firefox itself" for now? |
Generally leftmost tab may be long-live.
@irvinm To be honest I forgot why I gave up to store cache data per window instead of per tab, so I've reintroduce changes to store caches as an window value. You can activate this change with enabling a secret option |
Has anyone who has had problems with their session store file getting large try and comment on the new option? My session store file is only 4.3MB with 1003 tabs so I will not be trying. |
@piroor I believe this issue could be considered "expired" ... |
I close this because there looks to be no progress. |
I've had this issue occur recently, with large I have a somewhat redacted For now, I'm going to try running TST with the cache totally disabled on a basically empty session that I manually cleaned of all TST
|
Thanks for your efforts, @bb010g. Hopefully they'll allow to make further progress. Keep us updated ! |
I just had this same issue with TST version 3.8.16. For me, the bulk of the data was in z4jsoncat sessionstore.jsonlz4 | jq -c 'del(..|._closedTabs?)' >sessionstore.js This took the uncompressed size from 281M to 51M. |
Short description
The (uncompressed) size of Firefox session store file (sessionstore.jsonlz4) gets significantly bloated when using Tree Style Tabs.
This is mainly due to these keys that it adds, that are stored in
extData
in the session file:For example, after decompressing the lz4 compression, my session file was 257MiB. After removing these keys:
it shrunk to just 38MiB.
Why this is a problem
Once a session file becomes too large, it appears Firefox refuses to load it (even in safe mode), making it appear as if all the tabs have been lost.
Firefox failed to load the 257MiB file described in the previous section, but after stripping the TST cache related keys, it loaded correctly.
Admittedly, this is with a massive amounts of tabs, and you could argue that it's a bug in Firefox. However, without TST, you would need something like 20k+ tabs to make the session file grow to a similar size.
In addition to the above, I'm guessing that Firefox also has problems writing session files that are too large, because after crashing, the data in the recovery file was about one and a half month old (though it had been written just before the crash).
Environment
See also
Bug filed for Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1464685
Addendum
In case someone else who had the same issue finds this, here's what I did to make the session store loadable by Firefox again:
First use https://github.com/andikleen/lz4json to decompress the session file:
Then use jq (https://stedolan.github.io/jq/) to remove the cache-related keys:
Then place sessionstore.js in the Firefox profile directory. It should be possible to use either sessionstore.js, sessionstore.jsonlz4 or any file in sessionstore-backups in the Firefox profile directory as a base.
The text was updated successfully, but these errors were encountered: