Score:1

Swap partition configured, but showing 0 usage despite running out of memory

ma flag

I have an Ubuntu 20.04.2 machine that I configured to boot from raidz2. During the original setup, I chose not to use swap. At the time, I didn’t have a spare drive and I had heard that there could be issues using a swap file on a raidz partition. After finishing the install, I added a 2TB nvme drive and configured it as a swap partition.

When my system runs for a long while, the memory usage eventually hits 100% and Ubuntu hangs. Running glances just prior to this occurring shows the high memory usage but shows 0 of the swap being used.

I run the same processes on other machines and when they make use of the swap file and continue running without issue.

Any suggestions?

from free -h command:

             total        used        free      shared  buff/cache   available  
Mem:          125Gi       122Gi       1.0Gi       1.3Gi       2.6Gi       1.2Gi  
Swap:         127Gi       5.0Mi       127Gi


swapon -s
Filename                                Type        Size    Used    Priority  
/mnt/swapdrive/swapfile                 file        134217724   7424    -2
uz flag
In a terminal, please run swapon -s to determine if the system is aware of a swap area. cat /proc/sys/vm/swappiness will give you some insight as well. Default is 50 or 60. Might check your /etc/fstab to be sure you've got the correct UUID or partition referenced, and if using a swapfile, that the filename is correct.
Raffa avatar
jp flag
Does this answer your question? [No swapping on LUbuntu at enabled swap](https://askubuntu.com/questions/1165477/no-swapping-on-lubuntu-at-enabled-swap)
Rook13 avatar
ma flag
Filename Type Size Used Priority /dev/nvme4n1 partition 1953514580 0 -2 swappiness is set to 60, but I have tried 100 with no change to the behavior. fstab looks correct to me: UUID=071e37b9-a65d-4661-8309-f6c54183e074 none swap sw 0 0 Also, the swap is reported in glances and top, just always shows 0 used.
Rook13 avatar
ma flag
Please forgive the formatting issues, first time using this site. Trying the suggestion at Raffa's link now.
Rook13 avatar
ma flag
@sturge From reading through the guide, looks like I am supposed to @ you in my responses. My apologies for the prior oversight and I appreciate your suggestions.
Rook13 avatar
ma flag
@Raffa Tried the suggestion at the link. The system used 2.25MB of a 128GB swap file. Still ran out of memory. Reported 99.2% used. Used: 125G, free: 964M, active: 79G, inactive: 1.97G, buffers: 144M, cached: 2.51G. Anyone see anything wrong?
Raffa avatar
jp flag
I see swap is being used now ... Is the system still responsive? Is the used swap growing? ... Please [edit] your question to add the output of `free -h`
Raffa avatar
jp flag
Seeing the `free -h` output … looks normal as long as the system remains responsive … Swap is now used and it will grow in size if needed… system will utilize as much RAM as possible before moving pages to swap so it is normal now given there is still more than 1 GB of available RAM
Rook13 avatar
ma flag
@Raffa System eventually hung. I didn’t see if the swap usage ran any higher prior to the hang. My other system with the same hardware uses an entire 8G swap file but never exceeds 60% memory usage. I used the default settings during install for that machine.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.