- This topic has 9 replies, 5 voices, and was last updated Nov 16-8:23 pm by class413.
- November 13, 2023 at 1:29 am #123361Memberclass413
I run antix 22 live from a usb3 stick . on a Asus laptop
CPU i7-3537u, RAM 6 GiB, 17in screen with integrated CPU graphics and Nvidia 720M additional graphics adapter.
While running firefox for web browsing there is more and more of the ram as “Cache” l]with less Free ram. As an exemple, right now I see in the Memory icon in the low right corner of the desktop:
Memory Total: 5920 MB Free: 2098 MB Cached: 2885 MB Buffers: 211 MB User: 724 MB
When I download any files, it seems that their size is added to the Cache and subtracted from the free memory. If this free memory falls 500-600 MB the computer can freeze without any warning. Nothing works to make it continue to work, not even Control+Alt+Backspace that is supposed to kill X.
When I try to copy downloaded files to an external drive or usb stick occupied memory increases even more. Closing firefox frees a part of the memory.
By searching older threads I found in a discussion that cache is released each time the system need a link to the web pages more memory. There is also a link to the web page
However my own experience doesn’t agree with that.
What can I do with that problem? Is there any firefox setting to reduce that ram/cache used? Is it a Linux or antix issue?November 13, 2023 at 4:20 am #123368MemberRobin::
The firefox cache is stored in the home directory of each user, subfolder ~/.cache/mozilla/firefox
On antiX Live your home directory is located in RAM. So, depending on the size of your RAM firefox will use it up to insane values.
If firefox cache blows up, you can restrict it by setting some limits. Unfortunately they have hidden this somewhere in their huge registry, it’s not simply available in it’s settings page. Please read and try: https://support.mozilla.org/en-US/questions/1271481
Windows is like a submarine. Open a window and serious problems will start.November 13, 2023 at 7:27 am #123370Memberabc-nix::
You can free up cache with the command (run as root, not with sudo)
sync; echo 1 > /proc/sys/vm/drop_caches
I don’t use it myself, but you may be interested in creating a 1 GB Swap file, so that when RAM fills up, it at least doesn’t crash. You can enable swap on live-usb with the boot parameter:
You can also enable the option in Firefox to clear cookies and cache when closed. It still keeps the browsing history if that is important to you. If it isn’t, run firefox in private window mode, so that cache is cleared when the browser is closed.November 13, 2023 at 7:52 am #123375MemberXunzi_23::HelpfulUp1
Pls give usable information, which firefox are you using, have you tried a better browser,
LibreWolf and UngoogledChromium respect privacy. As Mozilla has been playing crazy games and
LibreWolf is based on ff freezing due low ram can occur, but it is rare.
Please also see if the latest antiX will run on your device, the recent kernels bring among
other enhancements better memory management.
For both Firefox ESR and Librewolf
Type about:config into the address bar, press Enter, now accept the warning, Copy following in to search, browser.cache.disk.smart_size.enabled
then double click the entry value will change from True to False. Restart Firefox. Copy following in to search. browser.cache.disk.capacity
Default is 1048576 = 1.048576 GB), then right click > Modify, and enter the maximum size you want in KB, Restart Firefox.November 13, 2023 at 8:27 am #123378MemberXunzi_23::
Somewhat OT but subject Firefox and Librewolf to a lesser extent.
Mostly gleaned from old posts, search the forum.
If you search through your firefox cache you will probably
find it full of advertizing images and other rubbish, along with all the evidence of what you do in
the internet and when..
Open the firefox browser features folder, you may want to keep picture in picture, delete the rest.
In the main folder rid yourself of pingsender crashreporter minidump analizer, not the init entrys,
the secret extensions are behind the cogwheel icons.
Location on antiX /usr/lib/firefox-esr
If not done already: install ublock
Consider using https://github.com/arkenfox/user.js/ Read the infos, it can break some sites.
The less crap there is in Memory or Cache the less your system has to work, the less risk of freezes.
LibreWolf does most of the work for you…But remembering only ESR accepts many changes including
through userchrome CSS, a longer story and a powerful tool.you can.
When Mozilla offers to fix or refresh your browser realize they offer because you made changes which cost
moz revenue and statistics, thats known because they are covertly tracking you.
Watch for Moz changing your settings remotely or creating a new profile in your home.
Profile is contained in /home/yourusername/.mozilla.
Your settings can be remotely changed, thats why arkenfox has a parrot function. It warns of tampering.November 16, 2023 at 2:09 am #123685Memberclass413::
Thank you all for your time and your replies.
I run antiX 22 from the live usb. Firefox version is 102.3.0esr (64-bit), obviously the one contained in the iso. Each time the system is booting, this is the same version running with the default settings.
I checked the firefox settings and found the cache size: “browser.cache.disk.capacity” is set to 256000, that is 256000 kiB, not big for the total RAM (5920 MiB). Because the system runs live (not from a hard drive, no swap) I guess that cache is located on RAM and not on any drive, despite the “disk” designation.
Furthermore I did check the free memory while browsing photography sites, even videos, to see what happens after some 100s of photos on screen. There was nothing excessive, with about half (or more) of the memory free. So, I think Firefox isn’t the cause of the problem. In fact, what is named “cache” in the memory icon near the clock in the lower right screen corner isn’t browser’s cache. It is perhaps some other cache, perhaps a cache related to the operating system ?
You probably can help me to understand what happens with downloaded files from the web. The problem occurred with file downloads using firefox. after download the file (say 1 GiB) is found in the ~/Downloads directory of the filesystem. This takes 1 GiB from the free memory. I guess the ~/Downloads directory is located entirely in RAM. Next to that, I plug another USB stick in another port and copy the downloaded file to that stick. I remark then that memory occupation increases, taking another 1 GiB from the free memory. This is something I wouldn’t expect. With 2 files like this (even smaller) the free memory falls under 0.5-0.6 GiB and the freeze problem can very probably arise. If I delete the file in the Downloads directory, some RAM is freed but I understand that the copy on USB still keeps memory. If I unmount the USB, it seems that the memory becomes free.
It seems to me that the copy on the USB is kept on RAM as a cache copy. However I would expect that the cache would be given back to the operating system if there is need of memory. Is all this normal?November 16, 2023 at 2:34 am #123686MemberRobin::
Because the system runs live (not from a hard drive, no swap) I guess that cache is located on RAM and not on any drive, despite the “disk” designation.
In case there exists a linux swap partition on a drive, antiX will use this swap automatically even when running live, if I’m not mistaken. So even when you say you didn’t set up a swap drive for the live system at will, it could one be in use without notice, simply because it was there already while booting.
Very interesting observations you’ve made. I’ll check whether I can confirm this, since I also run most time antiX as Live system. At least I wasn’t aware of this behaviour you describe when downloading and storing huge files.
Is all this normal?
Good question. Honestly, I don’t know. Maybe somebody else.
Windows is like a submarine. Open a window and serious problems will start.November 16, 2023 at 5:24 am #123689Memberabc-nix::
On popular demand, since antiX 23, the file manager uses a Trash Can. Now deleting files from the file manager doesn’t delete them from the system, but moves them to a hidden trash folder. When you delete files remember to also remove them from said folder (can be accessed from the file manager or the desktop icon under “Trash Can”).
When you run live, every little change is stored in RAM. The live system doesn’t have access to local storage, (except for the Live USB storage folder, but nothing is saved there if you don’t place it yourself). Updating the system will increase RAM use. Downloading or moving files will increase RAM use.
So, anything you store or change in the live system will take up space in RAM (except if you fully delete them from the live system, no Trash).
When a program launches for the first time, a config folder is created, that also takes up RAM. And every time you change something on your system, it creates/updates files, with the same result.
du -hc --max-depth=1 $HOME/.config
Also, all icons and miniature/thumbnails of files will be saved in the cache folder (that will take up RAM space as explained before). Even launching programs (even if you close them) will increase RAM use as it will cache some files for better/faster future runs.
du -hc --max-depth=1 $HOME/.cacheNovember 16, 2023 at 1:55 pm #123705Moderatorchristophe::
Adding to what abc-nix wrote, if you use static persistence the system will use that persistence file instead of RAM for much of these changes/files.
Also, changing your default downloads directory to ~/Live-usb-storage will keep your downloads saved to the usb “permanently,” and not in RAM.
You can use the Live-usb-storage folder to store files, regardless whether any persistence is used or not.
confirmed antiX frugaler, since 2019November 16, 2023 at 8:23 pm #123761Memberclass413::
Thank you very much for your additional info.
There was no swap partition in the system, because the hard drive (/dev/sda) had just a (now broken) win 8 installation with EFI partition, MS partition, system “C”, an empty “D” data partition and a win8 recovery partition. AntiX boots from the USB as /dev/sdb with no persistence. (In fact I tried last summer to make a usb with persistence but it seems that I didn’t understand well the various persistence styles. Unfortunately I lost somewhere that usb stick and forgot it after).
I understand that it is better to have a large RAM and/or additional cache/storage space to manipulate such big files. I must take advantage of persistence and swap too.
It is true that we learn from the problems we face.
I tried to set a second usb as destination for file saving within firefox, but it seems that I didn’t it right. I had already low free memory and tried to copy the files to the second usb. The result was that the system froze, I had to power the system off by the power button and of course lost the files. Nothing critical.
Looking about system’s cache and how it works, I found the page file-system-caching with info related to the subject and especially about settings on how the system uses the cache.
For checks and value setting, sysctl is used (with sudo). We can set values on cache size, how long pages remain on cache, how often the system looks for swap etc, and even store these values permanently to the system configuration files. I guess these values aren’t the same for every installation. In my live session these values were different from those shown in the article.
- This reply was modified 2 weeks, 1 day ago by class413.
- You must be logged in to reply to this topic.