ungoogled-software/ungoogled-chromium

Save hard disk SSD HDD by disabling session restore ou increase session store intervals

Open

#2,032 opened on Aug 4, 2022

View on GitHub
 (2 comments) (2 reactions) (0 assignees)Python (771 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (18,674 stars)
PR merge metrics
 (Avg merge 1d 11h) (9 merged PRs in 30d)

Description

Description

disabling session restore

Who's implementing?

  • I'm willing to implement this feature myself

The problem

Hello, i discover this article of 2016, this problems seems to affect also chromium browsers, it wil be great to save our hard disk and battery to add an option to disable session restore or increase session store intervals, we can do that with firefox but we can't do this with chrome browser, i have made search, i found solution but is complicated , may be it can help, please add option to disable completely session restore, many don't need this feature, we just use browser to watch some videos.....

Thank you in advance !

"Firefox (& Chrome) are eating our SSD's?!" "Chrome writing to disk every 15 secs" "Heavy SSD Writes Firefox is eating your SSD"

"Firefox and Chrome can shorten SSD lifetime September 26, 2016

Firefox and Chrome have been found to continuously write so much data that it might affect the durability of SSDs. Both browsers write an incredible amount of data to disk, even when idle.

firefox-with-32gb-written-in-a-single-day

This was discovered by researcher Sergei Bobik who used the software SSDLife to monitor how much data was read and written on his system. He found both browsers write a lot of data as they continuously make a backup of themselves"

https://myce.wiki/news/firefox-chrome-can-shorten-ssd-lifetime-80534/

https://forums.linuxmint.com/viewtopic.php?t=235651

https://www.servethehome.com/firefox-is-eating-your-ssd-here-is-how-to-fix-it/

"reduced to using Chrome, below is what is going on inside Firefox, it says Chrome does the same thing. I dont need this garbage of Chrome writing the whole page to my micro SD every 15 seconds. Has anybody found, useing a work around for Chrome, when I looked on the net I could not find anything about Chrome, it was all FF."

"by Nominal Animal Before switching to a laptop with a really, really fast SSD, I used to keep my active browser profiles on a ram disk (tmpfs).

Essentially, when inactive, your Firefox profile can be stored in a tarball (~/.mozilla/firefox/profilename.default.tar). When active, the contents of the tarball are extracted to a temporary directory on a tmpfs mount (ramdisk), with the ~/.mozilla/firefox/profilename.default pointing to that directory. The only real limitation of this approach is that you'll want to set the maximum cache size to something small; I happily used 0, 32 and 64 megabytes for years. (The no-cache one I used on a 2009 Acer Aspire One A110L minilaptop. It still works fine for casual web browsing.)

There are two approaches to maintaining such Firefox profiles.

First approach is to construct it at login, and deconstruct/repack it at logout. This is managed via a session manager script, and varies slightly between session managers. (I tried to get the necessary hooks for doing this in a transparent, safe manner to GDM, but got fed up with the lack of interest, and switched to LightDM.) The downside is that the profile is in memory even when you don't have a browser open, and if you keep yourself logged in all the time, the tarball version of the profile never gets updated.

Second approach is to customize or interpose /usr/bin/firefox (or /usr/bin/firefox-esr). It is a launcher shell script for Firefox. In it, the exec $MOZ_LIBDIR/$MOZ_APP_NAME "$@" causes the script to replace itself with the actual Firefox binary. If you edit the script, or use your own copy of the script, with the exec removed, the shell will remain in memory while the browser is still running. (In this case, I recommend using dash as the shell, if possible, for minimal resource use.) Before running the browser binary proper, the scriptlet checks if the session symlink points to a valid directory. If not, it sets it up. After the browser binary exits, the script tests if there are no more instances left (ps -o pid= -C firefox or ps -o pid= -C firefox-esr), and if not, re-tars the profile, and removes the temporary profile directory. (I preferred to use sync to ensure the data hits the disk, and notify-send to pop up a notification whenever the profile was safely stored on disk. That way, after making a number of new bookmarks or such, all I needed to do was to close and reopen the browser windows, to be sure they were safely stored on disk.)

For further information, search for firefox profile tmpfs and/or firefox profile ram with your preferred web search engine. Top

Gee wiss nominal animal, thats a long answer. I was asking about chrome. Go to 'firefox 55 crashing' to see what the experts say to do if you are using a solid drive.

oldchap wrote:
I was asking about chrome.

The approach I used with Firefox years ago works fine for chrome, too."

https://forum.odroid.com/viewtopic.php?t=29810

Possible solutions

Disable restore

Alternatives

No response

Additional context

No response

Contributor guide