swapoff failed: Cannot allocate memory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
util-linux (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
my memory situation is this:
4 GB ram total
2 GB used
8 GB swap partition in sda5
about 0 GB swap used
running command swapoff I got always the error below:
$ sudo swapoff -a
swapoff: /dev/sda5: swapoff failed: Cannot allocate memory
Seems swapoff always failed, when 'overcommit' is disabled (in my case for deterministic behave reasons)
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: mount 2.31.1-0.4ubuntu3.3
ProcVersionSign
Uname: Linux 4.18.0-16-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.5
Architecture: amd64
CurrentDesktop: MATE
Date: Thu Mar 7 23:38:20 2019
InstallationDate: Installed on 2016-12-01 (826 days ago)
InstallationMedia: Ubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
SourcePackage: util-linux
UpgradeStatus: Upgraded to bionic on 2018-09-23 (165 days ago)
to disable overcommit: vm/overcommit_ memory vm/overcommit_ ratio
echo 2 > /proc/sys/
echo 100 > /proc/sys/
Or better for persistence, put values in /etc/sysctl.conf memory= X and run sysctl -p. No need to reboot
vm.overcommit_