Usage of swap on Mint 20 Xfce (low memory, poor performance)

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
barhaqodes
Level 2
Level 2
Posts: 97
Joined: Mon Mar 27, 2023 3:33 pm

Usage of swap on Mint 20 Xfce (low memory, poor performance)

Post by barhaqodes »

Hello,
I am linux newbie. I was suggested Linux Mint Xfce because of the good performance and good look (similar to Windows). When I installed it it was not super fast, but fast enough to work in Firefox Mint (I could use like 3 or 5 sites or tabs open ... this is mostly stackoverlow or forums like this one). I have unpacked PaleMoon browser though because it is a bit faster and I could open like 5 or 6 sites or even more. About a week or two later the system is very slow. I almost dont use it. I really cannot run this FF Mint. I already tried FreeSpire linux with Gnome env. but man that was super slow and that is what killed my system (couldnt login to the "windows" environment). I was not able to login. Mint 20 is quite different story. I seems to be stable. But I think that the PaleMoon takes at least 800 MB of RAM (like two pages open, I cannot open more). And if I close it and I run FF Mint so I cannot open one singe site, even the settings was hard to.
Regarding PaleMoon, I wished like to forbit loading of JS, because the sites are full of ads and spy software... U know. How to fix the solution? When I have typed free -h, I see the system does not really use my swapping partition. It's like 2GB of size and should be enough, but the system does not use it. If I have seen using it finally it was like 500MB. Yet I got in problems when PaleMoon take ~1.2 GB of memory. I have a function which I used to find out the size of the PaleMoon (or FF) in memory. It doesnot work well from tty (generates some errros), but it runs well from xfce terminal (bash). Just a short code where I got the memory size of PaleMoon.

Code: Select all

sum=`ps -Al | grep "$1" | awk '{print $10}' | tr "\n" "+"`0; mib=`echo "($sum)/1024"|bc`; echo " $mib MiB ($1)";
I really want Mint start to use the swap earlier, not when it's too later and it takes like 5 minutes to react to I/O input, I think it could be increased like +450MB or 1.2GB of swap to get better performance. So if I remember the size of PaleMoon in memory is about 520-800 MiB and 122 MiB is the xfce terminal or even more. But the free capacity is 1.2 RAM only. So If I have two site in PaleMoon opened, a xfce terminal or two opened, tty3, tty2 and xed with two docs opened, it can get very slow like 0.5-1 minute reaction to change view from xed to PaleMoon.
Last edited by LockBot on Wed Sep 27, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
barhaqodes
Level 2
Level 2
Posts: 97
Joined: Mon Mar 27, 2023 3:33 pm

Re: Usage of swap on Mint 20 Xfce (low memory, poor performance)

Post by barhaqodes »

System info

Code: Select all

free -h && inxi -Sp
              total        used        free      shared  buff/cache   available
Mem:          2,8Gi       865Mi       1,3Gi       4,0Mi       627Mi       1,8Gi
Swap:         2,5Gi          0B       2,5Gi
System:
  Host: user-vm Kernel: 5.4.0-144-generic x86_64 bits: 64 
  Desktop: Xfce 4.14.2 Distro: Linux Mint 20 Ulyana 
Partition:
  ID-1: / size: 40.55 GiB used: 14.09 GiB (34.8%) fs: ext4 dev: /dev/sda3 
  ID-2: /home size: 5.84 GiB used: 1.65 GiB (28.3%) fs: ext4 
  dev: /dev/sda4 
  ID-3: swap-1 size: 2.54 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda5 
$ 
User avatar
MiZoG
Level 8
Level 8
Posts: 2171
Joined: Fri Jan 26, 2018 8:30 pm
Location: Athens, Greece

Re: Usage of swap on Mint 20 Xfce (low memory, poor performance)

Post by MiZoG »

Not optimal but 3gigs of ram was OK even for 20.3 Cinnamon.
I set up a Dell laptop for a friend powered by a sandy bridge "pentium" with 3 Gigs of ram.
It wasn't bad at all with 5-6 tabs in Firefox and a couple of other applications running.
Of course in the meanwhile Firefox might have become heavier.

Judging from what you are telling us, your system is in fact not running out of memory.
Swap remains unused.

Post your full specs inxi -Fxxxrz. Perhaps something else creates the bottleneck.

Pale Moon... :o
It has its own collection of addons.
A random search returns some results with regard to script blocking.

I regret to inform you that the crown of efficiency in ram usage among the "mainstream" browsers on Linux is currently held by... Microsoft Edge.

BTW, veteran Mint user Pjotr retains a very helpful blog with a lot of stuff about Mint Xfce optimization in particular.
Last edited by MiZoG on Tue Mar 28, 2023 2:37 pm, edited 1 time in total.
rickNS
Level 9
Level 9
Posts: 2905
Joined: Tue Jan 25, 2011 11:59 pm

Re: Usage of swap on Mint 20 Xfce (low memory, poor performance)

Post by rickNS »

barhaqodes wrote: Mon Mar 27, 2023 4:06 pm
I really want Mint start to use the swap earlier, not when it's too later and it takes like 5 minutes to react to I/O input, I think it could be increased like +450MB or 1.2GB of swap to get better performance. So if I remember the size of PaleMoon in memory is about 520-800 MiB and 122 MiB is the xfce terminal or even more. But the free capacity is 1.2 RAM only. So If I have two site in PaleMoon opened, a xfce terminal or two opened, tty3, tty2 and xed with two docs opened, it can get very slow like 0.5-1 minute reaction to change view from xed to PaleMoon.
Welcome to Mint forums.

Not sure you understand how swap works, as once the system starts swapping out everything that's using it gets slower, not faster.

Further, your memory alone is not your slowness problem as you have nearly half your memory free (1.3 free of 2.8) which is plenty, at least for current use.

Do post the full inxi report as requested above.
Mint 20.0, and 21.0 MATE on Thinkpads, 3 X T420, T450, T470, and X200
Reddog1
Level 7
Level 7
Posts: 1865
Joined: Wed Jun 01, 2011 2:12 pm

Re: Usage of swap on Mint 20 Xfce (low memory, poor performance)

Post by Reddog1 »

Hmmmm. Something is wrong with your system. I just closed down this Mint 21 virtual machine that I'm using, went into the VBox Manager and changed the virtual memory allotted to this system to 2GB, and rebooted the VM.

I'm typing this in the VM, with Firefox, with 10 tabs open, and I have no noticeable lag. Even on my laptops with only 4GB of ram, running Xfce as a VM with 2GB allotted, and 2GB for the host system, hasn't caused me any problems.

And I just opened a 11th tab........and now I have 14 open, and I still have 550 KiB free.

And while doing all that, I'm install Pinta from the Software Manager, so I can only conclude that you have a system problem. Timeshift maybe??
Petermint
Level 9
Level 9
Posts: 2976
Joined: Tue Feb 16, 2016 3:12 am

Re: Usage of swap on Mint 20 Xfce (low memory, poor performance)

Post by Petermint »

Your list of memory shows memory is not the problem. Probably disk. Rotating rust or SSD? All software does more with each release which means you need faster disk. If not using SSD, upgrade.

Noscript is the Firefox addon to block Javascript. I use it. Is good.

Your list of memory usage. It it after a boot or after long usage? Run the list once during a slow period and one after a clean boot before starting anything. The difference will show you what the applications are using.

Do you leave your machine on all the time or reboot each day? A reboot each day will clean out all the temp files and junk that can slow down applications.

After the upgrade to SSD, a daily reboot, and Noscript, the next thing to change is a Firefox setting to cut down on disk writes.

There are a heap of other things we could look at with the full inxi report or copy the text from System Reports, System Information.
Hoser Rob
Level 20
Level 20
Posts: 11762
Joined: Sat Dec 15, 2012 8:57 am

Re: Usage of swap on Mint 20 Xfce (low memory, poor performance)

Post by Hoser Rob »

MiZoG wrote: Tue Mar 28, 2023 9:04 am ... Post your full specs inxi -Fxxxrz. Perhaps something else creates the bottleneck....
Yes, do that. Without proper system info you're just going to get speculation.

I will say that swap/swappiness isn't a magic bullet. When a Linux system is about to run out of RAM it's going to either steal pages from your program cache or page to swap. All increasing swappiness does is tell it to prefer, in varying degrees according to the actual number, paging to swap over taking pages from disk cache. Both will increase disk activity.
For every complex problem there is an answer that is clear, simple, and wrong - H. L. Mencken
barhaqodes
Level 2
Level 2
Posts: 97
Joined: Mon Mar 27, 2023 3:33 pm

Re: Usage of swap on Mint 20 Xfce (low memory, poor performance)

Post by barhaqodes »

I am sorry for delay. In the meantime I have found some more problems. In Windows when I checked tool called CrystalDiskInfo, I have found, that the disk, where the Mint is installed, is not functioning well. There are 200 bad sectors out of 183 limit. Warning. And in HW monitor tool I have seen that the SATA disk transfer speed in 3 gbs instead six. This could be source of one problem. And the second problem is that half hour earlier I have run "task manager" here in Mint - I cannot recall its name - it has similar icon like Htop, but it is Xce app and it displays the diagram of CPU load. So the CPU when it should be like 1-2 perc. of load it was 4 - 7 but slow. But then 30 second later 17 perc. 30, 40, 60 etc. 70! confused? I think the browser was either close or iddle. And U R right, there is plenty of RAM. This does not have to do with the RAM or SWAP but CPU usage.

I am going to read your massages, so I will update this post a bit later.

Code: Select all

inxi -Fxxxrz
System:
  Kernel: 5.4.0-144-generic x86_64 bits: 64 compiler: gcc v: 9.4.0 
  Desktop: Xfce 4.14.2 tk: Gtk 3.24.13 info: xfce4-panel wm: xfwm4 
  dm: LightDM 1.30.0 Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal 
Machine:
  Type: Vmware System: VMware product: VMware Virtual Platform v: N/A 
  serial: <filter> Chassis: No Enclosure type: 1 serial: <filter> 
  Mobo: Intel model: 440BX Desktop Reference Platform serial: <filter> 
  BIOS: Phoenix v: 6.00 date: 07/02/2012 
CPU:
  Topology: 4x Single Core model: AMD FX-8300 bits: 64 type: SMP 
  arch: Bulldozer L2 cache: 8192 KiB 
  flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 
  bogomips: 26488 
  Speed: 3311 MHz min/max: N/A Core speeds (MHz): 1: 3311 2: 3311 3: 3311 
  4: 3311 
Graphics:
  Device-1: VMware SVGA II Adapter driver: vmwgfx v: 2.15.0.0 
  bus ID: 00:0f.0 chip ID: 15ad:0405 
  Display: x11 server: X.Org 1.20.13 driver: vmware 
  unloaded: fbdev,modesetting,vesa resolution: 800x600~60Hz 
  OpenGL: renderer: SVGA3D; build v: 2.1 Mesa 21.2.6 direct render: Yes 
Audio:
  Device-1: Ensoniq ES1371/ES1373 / Creative Labs CT2518 
  driver: snd_ens1371 v: kernel bus ID: 02:02.0 chip ID: 1274:1371 
  Sound Server: ALSA v: k5.4.0-144-generic 
Network:
  Device-1: Intel 82371AB/EB/MB PIIX4 ACPI vendor: VMware Virtual Machine 
  type: network bridge driver: N/A port: 10c0 bus ID: 00:07.3 
  chip ID: 8086:7113 
  Device-2: Intel 82545EM Gigabit Ethernet 
  vendor: VMware PRO/1000 MT Single Port driver: e1000 v: 7.3.21-k8-NAPI 
  port: 2000 bus ID: 02:01.0 chip ID: 8086:100f 
  IF: ens33 state: up speed: 1000 Mbps duplex: full mac: <filter> 
Drives:
  Local Storage: total: 515.76 GiB used: 46.37 GiB (9.0%) 
  ID-1: /dev/sda vendor: VMware model: Virtual IDE Hard Drive 
  size: 465.76 GiB speed: <unknown> serial: <filter> rev: 0001 scheme: MBR 
  ID-2: /dev/sdb vendor: VMware model: Virtual S size: 50.00 GiB 
  serial: N/A rev: 1.0 scheme: GPT 
Partition:
  ID-1: / size: 40.55 GiB used: 13.90 GiB (34.3%) fs: ext4 dev: /dev/sdb3 
  ID-2: /home size: 5.84 GiB used: 1.72 GiB (29.5%) fs: ext4 
  dev: /dev/sdb4 
  ID-3: swap-1 size: 2.54 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sdb5 
Sensors:
  Message: No sensors data was found. Is sensors configured? 
Repos:
  No active apt repos in: /etc/apt/sources.list 
  Active apt repos in: /etc/apt/sources.list.d/google-chrome.list 
  1: deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/google-earth-pro.list 
  1: deb [arch=amd64] http://dl.google.com/linux/earth/deb/ stable main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
  1: deb http://packages.linuxmint.com ulyana main upstream import backport #id:linuxmint_main
  2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
  3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
  4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
  5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
  6: deb http://archive.canonical.com/ubuntu/ focal partner
  Active apt repos in: /etc/apt/sources.list.d/opera-stable.list 
  1: deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser (final releases)
  Active apt repos in: /etc/apt/sources.list.d/winehq.list 
  1: deb [signed-by=/usr/share/keyrings/winehq.gpg] http://dl.winehq.org/wine-builds/ubuntu/ focal main
Info:
  Processes: 210 Uptime: 20m Memory: 2.79 GiB used: 844.9 MiB (29.6%) 
  Init: systemd v: 245 runlevel: 5 Compilers: gcc: 9.4.0 alt: 9 
  Shell: bash v: 5.0.17 running in: xfce4-terminal inxi: 3.0.38 
Edit:
I think the memory or swap use does not change much. I am here on linux just a hour or two just to read articles of Linux topic or to try bash scripting. I dont install any apps. Yesterday I tried Opera - just got to settings page and I had to reboot the linux. Damn It was so slow. For one click and waiting for opening a page of browser search settings because I wanted to get rid of google search engine on the new tab, so I have waited like 5 minutes to open that settings. Not sure if gettin the results. So I just rebooted. Opera is damn slow. Much worst than Firefox. Edge is product of MS, Im gonna avoid of using it...

So according boot.log is is near to an hour the Mint is on. The PaleMoon and this forum page is open.

Code: Select all

free -h
              total        used        free      shared  buff/cache   available
Mem:          2,8Gi       822Mi       1,2Gi       6,0Mi       814Mi       1,8Gi
Swap:         2,5Gi          0B       2,5Gi
user@user-vm:~$ 
Is there any command to xfce terminal to run to find out the current CPU usage? I could send it to you.
barhaqodes
Level 2
Level 2
Posts: 97
Joined: Mon Mar 27, 2023 3:33 pm

Re: Usage of swap on Mint 20 Xfce (low memory, poor performance)

Post by barhaqodes »

Once again, after a break: Browser still loaded, this forum still loaded and no other site loaded since. So its like 10-15 minutes later:

Code: Select all

free -h
              total        used        free      shared  buff/cache   available
Mem:          2,8Gi       1,0Gi       798Mi       6,0Mi       1,0Gi       1,6Gi
Swap:         2,5Gi          0B       2,5Gi
barhaqodes
Level 2
Level 2
Posts: 97
Joined: Mon Mar 27, 2023 3:33 pm

Re: Usage of swap on Mint 20 Xfce (low memory, poor performance)

Post by barhaqodes »

Interestingly, according to htop, PaleMoon now took 2.2 GB (or 2.17 GB) and now takes 2.1 GB RAM - more exacty 2129M but this is after I closed one tab with forum site. When on 2.2GB the system almost frees. I could not close it. I clicked on "x" and waited like 5-10 minuts to close. But I have killed few proceses which according to htop taken like 250-450 MB. One of these processes was update service and the second... I cannot recall what I have killed, but suddenly the PaleMoon closed successfully. And after the next start of it, I could read the forum site without any problem. Now its 732 M free, 1.1 G usesed and 990M buffered.
Locked

Return to “Beginner Questions”