Memory and disk usage UM 24.04

Before upgrading to UM 24.04 the memory on my system was used at about 43%
My laptop is 1T and it is like it is used 94%... There seems to be some duplication.
Also, the swap is used near zero most of time, but then suddenly it jumps at 75% or even 100% - which I was not able to associate with any specific application.
I'd like to avoid starting afresh with a clean re-install, given it is a daily use laptop.


I am just a normal basic user - so any suggestion here would be welcome.

System

Thanks in advance

W

mate-system-monitor might be of help. It will tell things such cpu usage and what processes are running.

The following information could help to investigate swap usage:

https://www.cyberciti.biz/faq/linux-which-process-is-using-swap/

Good luck!

3 Likes

Yes thanks for that.

While the real issue I was raising here is not really the swap use (which I underlined), but this " /var/snap/firefox/common/host-hunspell " which seems to grab/eat so much of the memory and basically by same size then the actual "/"....

Just need to understand what for. What is the problem it creates. It would be weird to end up with no mem left on a 1T laptop....
I was told to sweep clean the laptop and reinstall everything without snap... Not really attractive for me.

W

I see. Surely,

is an overkill and actually guarantees no effect for the host-hunspell is for spelling dictionary. More information is here: [SOLVED] Why is Firefox 'host-hunspell' being loaded at boot?

Well, there are some tips regarding memory usage.

First, regarding free command output. Linux OS kernel internally uses a lot of memory for caching and buffering. Nevertheless, that memory is immediately freed on demand whenever user's application needs it. That is, your system actually has much more memory available than 'free' RAM listed in the command output. For more details see man free. All in all, there is nothing to bother about until you notice actual performance degradation.

Second, you can decrease swapping rate by setting a different value of vm.swappiness parameter using the following link

https://help.ubuntu.com/community/SwapFaq

3 Likes

I see. Many thanks.... illuminating.
So in layman's term it means that what it shows as a memory grab ends up only a 'ghost' created by an access to system files. Kind of misleading....
How is such an access to system files limited ?

You are correct in that bind mount of "/var/snap/firefox/common/host-hunspell" refers to the existing space which is shown/counted twice due to the trick.

As far as I know, 'snaps' have been intentionally limited in their access to the rest of the system due to security considerations.

Hopefully, this helps.

3 Likes

Eugene, you're the best.
Thanks again.
Maybe I was late into trying to figure this one out...
Hope it helps others also trying to understand.

W

3 Likes

I agree with you. I use either synaptic package manager or .deb files.

2 Likes

Hi, @Watford!

I am pretty sure I saw this host-hunspell mount after the 20.04->22.04 upgrade. And the host-hunspell connection was a blocker for Firefox .snap removal.

After disconnecting, I was able to get rid of the FF .snap.

snap disconnect firefox:host-hunspell

The mount has gone as well.

3 Likes

Regarding space and snap you might be interested in this forum thread since it explains how snaps save older versions and how you can create a script that clears up space for new versions or other files. It will surely help in case you don't want to purge all snap apps but still need to clear duplicates made by upgrades to newer versions.

Link from main Ubuntu forum: 20.04 - Can I remove the older revision package of duplicated snap packages? - Ask Ubuntu

Hope you find the solution that works !

3 Likes

Now I get this message:

W

Hmm it is really strange given that you've said you've got 1TB of space (I have quarter of that and don't have any problems)

My advice would be (if nothing else worked or you didn't try that already) to manually reinstall new Ubuntu MATE version and to look for the checkbox in the installer when the process gets to the part with partitions I know that somewhere along the options I had to click "ERASE DISK AND INSTALL UBUNTU" (I gather you have home and root partition separated so all your files and folders won't be swiped) - as it will clear out only the root partition where Ubuntu MATE is being installed and might fix the problem

You really should not have so much memory taken in any case since Ubuntu MATE is really light - I mean it was the main point I switched from Mint MATE because in spite of snaps it takes a lot less space on my laptop so I believe purging all snap apps is kinda redundant if you have 500GB root partition - mine is around 50GB and have 35GB left to spare

Anyways reinstalling it fresh clean from USB should take you around 20min max - it took me longer to mount ISO on USB than it took to click all the install options :laughing:

Hope you fix the problem soon !

1 Like

Hi, @Watford :slight_smile:

You wrote:

That's intriguing! Could you please run the following command and post another reply with the corresponding output?

df -hT /

3 Likes

Result of df -ht /

as of now....

W

1 Like

Hi again, @Watford :slight_smile:

You wrote:

Thanks for the output :slight_smile: If you wish, you may run the following command which will list the 25 largest directories of the / filesystem (without descending to other filesystems) and their respective sizes. That may help you identifying the culprit:

sudo du -h --one-file-system / | sort -rh | head -n 25

2 Likes

This does not look like a 1TB setup at all.
You have separate partitions for /boot, /boot/efi and a large 500GB LUKS container for your root filesystem. And it is almost full.

2 Likes

Here:

root@user:/home/user# du -h --one-file-system / | sort -rh | head -n 25

du: cannot access '/home/user/pCloudDrive': Permission denied
du: cannot access '/tmp/.mount_pcloudJOBV5w': Permission denied
416G /
384G /home/user
384G /home
193G /home/user/snap
189G /home/user/snap/thunderbird/common
189G /home/user/snap/thunderbird
188G /home/user/snap/thunderbird/common/.thunderbird/88360zp9.default-release
188G /home/user/snap/thunderbird/common/.thunderbird
187G /home/user/snap/thunderbird/common/.thunderbird/88360zp9.default-release/ImapMail
149G /home/user/snap/thunderbird/common/.thunderbird/88360zp9.default-release/ImapMail/imap.gmail.com
141G /home/user/.thunderbird/88360zp9.default-release
141G /home/user/.thunderbird
140G /home/user/.thunderbird/88360zp9.default-release/ImapMail
107G /home/user/.thunderbird/88360zp9.default-release/ImapMail/imap.gmail.com
65G /home/user/snap/thunderbird/common/.thunderbird/88360zp9.default-release/ImapMail/imap.gmail.com/[Gmail].sbd
43G /home/user/.thunderbird/88360zp9.default-release/ImapMail/imap.gmail.com/[Gmail].sbd
38G /home/user/snap/thunderbird/common/.thunderbird/88360zp9.default-release/ImapMail/imap.gmail-1.com
33G /home/user/.thunderbird/88360zp9.default-release/ImapMail/imap.gmail-1.com
29G /home/user/snap/thunderbird/common/.thunderbird/88360zp9.default-release/ImapMail/imap.gmail-1.com/[Gmail].sbd
24G /home/user/.thunderbird/88360zp9.default-release/ImapMail/imap.gmail-1.com/[Gmail].sbd
22G /home/user/MEGA/A BCG
22G /home/user/MEGA
21G /var
18G /var/lib
9.7G /var/lib/snapd

2 Likes

Hi again, @Watford

Thanks for the output :slight_smile: I have the following comments:

1 - I agree with @ironfoot regarding the reply he gave you above - "Memory and disk usage UM 24.04 - #17 by ironfoot" : it seems that the NVMe SSD - nvme0n1 - where you have installed your Ubuntu MATE 24.04 LTS ("Noble Numbat") is about 500 GB (476.9G) in size and not 1 TB, as you can see in the first line of the beginning of the "lsblk" output that you included in your original post in this topic:

2 - Your / filesystem is 416 GB in size. The /home directory seems to be part of that / filesystem and not a separate filesystem (both options are perfectly reasonable, in my opinion).

3 - Your /home/user directory is occupying 384 GB:

384G /home/user

4 - Of those 384 GB, the following "Mozilla Thunderbird" user profile seems to be taking about 188 GB in size:

188G /home/user/snap/thunderbird/common/.thunderbird/88360zp9.default-release

5 - I'm guessing that the majority of the remaining space is being taken by your /home/user/pCloudDrive but I can't say for sure given that I'm unfamiliar with "pCloud" and also because of the following "Permission denied" lines which hide the space that it's occupying:

root@user:/home/user# du -h --one-file-system / | sort -rh | head -n 25

du: cannot access '/home/user/pCloudDrive': Permission denied
du: cannot access '/tmp/.mount_pcloudJOBV5w': Permission denied

I hope this helps :slight_smile:

3 Likes

Even worse: it looks like this massive user profile was duplicated during the .deb-->.snap upgrade, compare:

/home/user/.thunderbird/

and

/home/user/snap/thunderbird/common/.thunderbird/

directories.

3 Likes