Swapspace doesn't remove swapfile
oktorok opened this issue · 9 comments
Hi, i have just installed swapspace in an ubuntu 18.04 server, the reallocation of swapfiles is correct but in the moment i stop my programs the swapfiles arent removed, i tried to execute swapspace -e only for test and give me an error about:
"Could not enamble swapfile '2': Device or resource busy"
But when i check with
"swapon --show"
the swapfile '2' is completly empty. Did i miss some configuration or somewthing?
It has been almost a day and the swapfiles still there, and i can't make swapspace -e or service swapspace restart for remove the swapfiles. I could make service swapspace stop and swapoff -all but i would prefer to be authomatic, any idea?
i could think that maybe there are programs with info in the swapfile (because actually i have 3 swapfiles of 8 gigas and one of them has 300 Megas written) but since i have swapfiles empty why they don't deallocate? is swapspace waiting for deallocate everyfile or something?
I have done this:
sudo service stop swapspace
sudo swapspace -v
[in another terminal]- program that use a lot of RAM for check swapspace
- wait for swapspace allocate something and stop program
this is the output from swapspace:
steady -> overfed
overfed -> steady
steady -> overfed
overfed -> steady
steady -> overfed
overfed -> steady
steady -> overfed
overfed -> steady
steady -> overfed
overfed -> steady
Notice: Allocating swapfile '1'
Setting up swapspace version 1, size = 8 GiB (8589930496 bytes)
no label, UUID=65665f5c-d765-4140-8471-269a4443baff
steady -> hungry
hungry -> steady
steady -> overfed
overfed -> steady
steady -> overfed
overfed -> steady
steady -> overfed
overfed -> steady
steady -> overfed
overfed -> steady
steady -> overfed
overfed -> steady
and goes on like that
A thing that i have thought is: i have installed swapspace from apt install, is it possible that the apt version is outdated or something and the correct one is compiling from source?
You're a few versions behind, but this appears to be an issue with the state machine, which has not seen any changes since the version you're on.
However, if you can update to current master, I've just pushed a change that should increase verbosity a bit so we can see what's going on here.
If you could update and log swapspace output to a file before repeating the steps you took above that would be much appreciated.
I have purged swapspace and reinstalled it from source
Now when i execute swapspace
it creates automatically a swapfile (is not a bad thing is only that before it didn't do it) and i have notice a faster performance reallocating new swapfiles. Despite that still not deallocating the swapfiles but now if i execute swapspace -e
it, deallocates the swapfiles.
Anyway the output of the process is in this file
Don’t worry about it! Glad it’s now working properly