# swap_pager_getswapspace: failed



## wattie (Jun 12, 2017)

I get lots of these in /var/log/messages:


```
Jun 13 00:33:38 srv2 kernel: swap_pager_getswapspace(5): failed
Jun 13 00:33:38 srv2 kernel: swap_pager_getswapspace(8): failed
Jun 13 00:33:38 srv2 kernel: swap_pager_getswapspace(5): failed
```

Here is the output of the top command (sorted by size):


```
last pid: 71242;  load averages:  4.38,  3.96,  3.57                                                                                                                                                                up 112+03:14:36 00:33:41
244 processes: 4 running, 240 sleeping
CPU:  8.2% user,  5.9% nice, 12.8% system,  0.0% interrupt, 73.0% idle
Mem: 3038M Active, 24G Inact, 3170M Wired, 1598M Buf, 484M Free
Swap: 4096M Total, 3843M Used, 253M Free, 93% Inuse

  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME    WCPU COMMAND
73908 mysql        65  20    0  8948M  2571M select  8  26.6H  82.25% mysqld
96273 root          2  20    0   734M   535M select  0 125.1H   0.00% clamd
 7743 root          1  20    0   259M   168M select  5   3:06   0.00% perl
57615 apache      147  52    0   226M   102M piperd  3   0:18   1.41% httpd
...
```

Despite that error in the logs, I don't see anything going wrong - all services appear to be running fine.

As you can see I have lots of Inact memory. How do I find out what is using the swap and why?


----------



## SirDice (Jun 13, 2017)

wattie said:


> Despite that error in the logs, I don't see anything going wrong


You're running out of swap space. It's 93% in use.



wattie said:


> How do I find out what is using the swap and why?


The machine looks to have 8GB and MySQL is using 8 or more. That's never a good idea. There's just nothing left for everything else. Tune MySQL to use less memory, never allow it to use more memory than physically is in the box. Typically you configure about 2/3 memory for MySQL. If you have lots of other things running on it you may want to lower that number.


----------



## wattie (Jun 13, 2017)

Please take a better look at the top. I have 32GB of ram.


```
root@srv2:~ # sysctl hw.physmem
hw.physmem: 34207567872
```


```
root@srv2:~ # grep memory /var/run/dmesg.boot
real memory  = 34359738368 (32768 MB)
avail memory = 33138290688 (31603 MB)
```


----------



## SirDice (Jun 13, 2017)

Oops, didn't have my coffee yet. You appear to have a lot of inactive memory. The reason it's using swap is because most of your memory is inactive, which cannot be freed for other purposes. I'd look into what's eating the inactive memory, swap usage is a consquence not the cause. Some application could have a memory leak.


----------



## wattie (Jun 13, 2017)

Oook... and I have no clue where to start from, hehe 

I will give "sysctl vm.defer_swapspace_pageouts=1" a try and will see if it will change anything...


----------



## wattie (Jun 16, 2017)

It looks like that fixed the issue.


----------



## fernandel (Jun 17, 2017)

wattie said:


> Oook... and I have no clue where to start from, hehe
> 
> I will give "sysctl vm.defer_swapspace_pageouts=1" a try and will see if it will change anything...



I had the same problem on my FreeBSD 11-RELEASE (8 G of RAM) when I am building ports with Synth and I did try your settings and it works .


----------



## wattie (Jun 18, 2017)

Yep, after I enabled that, I have a constant 


```
Swap: 4096M Total, 96M Used, 4000M Free, 2% Inuse
```


----------



## FilippoMo (Aug 13, 2018)

I tried your fix and I get the following:
[root@sting /home/filippo]# sysctl vm.defer_swapspace_pageouts=1
sysctl: unknown oid 'vm.defer_swapspace_pageouts'
Filippo


----------



## jpierri (Aug 13, 2018)

Perhaps this answer explain that.


----------



## rsronin (Feb 18, 2019)

I have similar issues. I am on 12-RELEASE and use packages from the 'latest' repository.

I have KDE5 installed on an old hdd and after `pkg update -f` and `pkg upgrade` KDE didn't finish starting and ended with a black screen and a cursor. First I thought it had something todo with the hdd because it had bad sectors.

Yesterday I did a clean installation of 12-RELEASE-p3 and KDE5 on an other drive. Same issues, even though the installer had created (a bigger) swapspace because the size of the drive is bigger.

I am using the nvidia-driver and pkg only.


----------



## Wozzeck.Live (Feb 18, 2019)

I have never had such issue speaking of desktop installation

I usually setup a swap size in the range of x1.5 to x2 the ram installed as recommended by the handbook

If one has 32 GB of ram, one should theoretically setup a swap of 48 GB at a minimum.....
For 8 GB, a common size of ram today, swap should be at 12 GB minimum

In some cases, swap size may have to be increased to more than x2, but this is in a server context, running for example big databases.

I can encounter such issue with a "portable freesbsd usb stick", but in such case I deactivate the swap

Using Swap with USB stick generally slows down the system because it generates too much IO traffic
Sometimes the swap is full because USB key encounters too much IO traffic, and has some problems to refresh the swap partition.
And as USB Stick is just a recovery key for general purpose in order to repair a broken system, I can't adapt the swap size... so the solution is to deactivate the swap in such context.

So yes... this kind of message may in some cases reveal some read/write  issues with hard drive, especially some very slow hard drives


----------



## rsronin (Feb 18, 2019)

I tried to disable the swap partition and that resulted in that both `plasmashell` and `kwin_x11` where killed (out of swapspace).

I kept the swapspace disabled and created a swapfile of twice the size of the installed memory and mounted it as md99. Same result, plasmashell was killed (out of swapspace).

I'm out of ideas right now, maybe this is Plasma/KDE5 related!?


----------



## Wozzeck.Live (Feb 18, 2019)

rsronin said:


> I tried to disable the swap partition and that resulted in that both `plasmashell` and `kwin_x11` where killed (out of swapspace).
> 
> I kept the swapspace disabled and created a swapfile of twice the size of the installed memory and mounted it as md99. Same result, plasmashell was killed (out of swapspace).
> 
> I'm out of ideas right now, maybe this is Plasma/KDE5 related!?




You use a swap file.
I personally don't use swap file, I use a dedicated swap partition.
This might be the issue...

When you create a swapfile, it also depends on how you create this swap file.
It is known that swap needs contiguous space.... so if you set a swap file with a maximum but variable size, if your system runs out of space, it may have some issues to find contiguous space and swapping process goes to error.
If you have defined a fixed swap size, problem shouldn't occur because system should have written a file filled with zero to reserve the contiguous space

According to me using a swap file is not the good solution
You must set a swap partition that is the best guaranty that contiguous max swap size will be always here
You can possibly add a swap file as a complement to a swap partition


PS : Note that UFS, like many other Linuxes filesystem, theoretically is not fragmenting files as NTFS does. But this is theoretical and factually wrong. There is always a little fragmentation, and in any case when available space is reduced, technically UFS has no other solution than fragmenting files. When we say that a given filesystem is not fragmenting this only means that the filesystem will try to defragment files online, so moving files in the background in order to keep each of them contiguous.... if possible, because this requires enough free space. On the contrary NTFS has been designed as an offline defragmenting system. Microsoft has choosen to not implement an online defragmentation in order to keep a good velocity and so Windows Server pushes a defragmentation process in a scheduled task... for example during the night when employees are sleeping. So keep in mind that UFS, EXTs require a lot of free space to work correctly.


----------



## rsronin (Feb 18, 2019)

Wozzeck.Live said:


> You use a swap file.
> I personally don't use swap file, I use a dedicated swap partition.
> This might be the issue...
> 
> ...



The swapfile was created like this:

`dd if=/dev/zero of=/swapfile.dat bs=1m count=8192
chmod 0600 /swapfile.dat`

I added this to /etc/fstab:

`md99       none       swap       sw,file=/swapfile.dat      0     0`

I used a dedicated swap partition before but that was only 4GB, the swapfile is 8GB (2 times the memory size).

Actually it all happened after the latest `pkg update -f`and `pkg upgrade` I did last week (old hdd with bad sectors, seagate barracuda 7200.7 120GB) and yesterday (another hdd (old but no bad sectors), seagate barracuda 7200.10 320GB)

Will try a clean install later with a dedicated swap partition of 8GB instead of 4GB, but my gut feeling says nvidia/kde.


----------



## Vull (Feb 18, 2019)

@ *rsronin* - I agree that a dedicated swap partition is a good thing to have for KDE, and I'd also suggest turning off the File Search feature in your KDE System Settings.  The file search is a big CPU and memory hog, and whenever I've left it on, I've experienced core dumps and thrashing problems which I don't experience otherwise. I also go though all the other settings and turn off all the busy features I never use, because frankly KDE is way too busy out of the box IMO.

I've been trying out various variants of kde4, kde5, and plasma5-plasma on a 32-bit Dell with only 3 GB of RAM, but I always have a swap partition just under 6 GB in size according to FreeBSD recommendations. If I partition exactly 6 GB (2 * RAM), I always get complaints in dmesg that it's just a little too big, so I reinstall from scratch and adjust the swap partition size according to their exact recommendation in dmesg. (It always works out to 6110720K in FreeBSD 11.2 and 6096384K in FreeBSD 12.0, don't ask me why.) The resulting configurations run well and smoothly, even if a little slowly due to my limited resources, and even on top of apache and postgresql server services running on the same hardware. No coredumps and no thrashing under reasonable loads, but it definitely does need a little tweaking in the System Settings to avoid them.

Another way of reducing resource usage is to install the plasma5-plasma port or package instead of kde5. You can then add only the features you actually use, like konsole, dolphin, firefox, libreoffice, kcalc, vlc, and/or whatever, and avoid a lot of the overhead that comes with all the built-ins. But my systems still run smoothly even with the full blown kde4 or kde5 software-- but still, _only after I disable the baloo file search._ They may have improved the file search programs in the newer editions but I wouldn't know since I don't need and always disable it anyway.


----------



## rsronin (Feb 18, 2019)

Vull said:


> @ *rsronin* - I agree that a dedicated swap partition is a good thing to have for KDE, and I'd also suggest turning off the File Search feature in your KDE System Settings.  The file search is a big CPU and memory hog, and whenever I've left it on, I've experienced core dumps and thrashing problems which I don't experience otherwise. I also go though all the other settings and turn off all the busy features I never use, because frankly KDE is way too busy out of the box IMO.
> 
> I've been trying out various variants of kde4, kde5, and plasma5-plasma on a 32-bit Dell with only 3 GB of RAM, but I always have a swap partition just under 6 GB in size according to FreeBSD recommendations. If I partition exactly 6 GB (2 * RAM), I always get complaints in dmesg that it's just a little too big, so I reinstall from scratch and adjust the swap partition size according to their exact recommendation in dmesg. (It always works out to 6110720K in FreeBSD 11.2 and 6096384K in FreeBSD 12.0, don't ask me why.) The resulting configurations run well and smoothly, even if a little slowly due to my limited resources, and even on top of apache and postgresql server services running on the same hardware. No coredumps and no thrashing under reasonable loads, but it definitely does need a little tweaking in the System Settings to avoid them.
> 
> Another way of reducing resource usage is to install the plasma5-plasma port or package instead of kde5. You can then add only the features you actually use, like konsole, dolphin, firefox, libreoffice, kcalc, vlc, and/or whatever, and avoid a lot of the overhead that comes with all the built-ins. But my systems still run smoothly even with the full blown kde4 or kde5 software-- but still, _only after I disable the baloo file search._ They may have improved the file search programs in the newer editions but I wouldn't know since I don't need and always disable it anyway.


I experimented both with kde4 and kde5 before. I disabled file searching with `balooctl disable` on those installations. Also I just installed only plasma5-plasma with some other kde applications like dolphin and konsole.

I just reinstalled FreeBSD-12-RELEASE and gave it 8GB of dedicated swapspace. On purpose I did *not upgrade to p3* (`freebsd-update fetch` and `freebsd-update install`). Neither did I use the latest pkg repo, but the quarterly one. For the time being it works now but scared to upgrade.


```
$ cat /etc/fstab
# Device        Mountpoint      FStype  Options Dump    Pass#
/dev/ada2p2     /               ufs     rw      1       1
/dev/ada2p3     none            swap    sw      0       0

$ gpart show
=>       34  488397101  ada0  GPT  (233G)
         34       2014        - free -  (1.0M)
       2048   40960000     1  linux-data  (20G)
   40962048   40960000     2  linux-data  (20G)
   81922048   40960000     3  freebsd-ufs  (20G)
  122882048  348160000     4  linux-data  (166G)
  471042048   17354752     5  linux-swap  (8.3G)
  488396800        335        - free -  (168K)

=>        34  5860533101  ada1  GPT  (2.7T)
          34        2014        - free -  (1.0M)
        2048  5860530176     1  linux-data  (2.7T)
  5860532224         911        - free -  (456K)

=>       40  625142368  ada2  GPT  (298G)
         40       1024     1  freebsd-boot  (512K)
       1064  608174080     2  freebsd-ufs  (290G)
  608175144   16967264     3  freebsd-swap  (8.1G)

=>        40  1953525088  ada3  GPT  (932G)
          40        2008        - free -  (1.0M)
        2048  1953521664     1  freebsd-ufs  (932G)
  1953523712        1416        - free -  (708K)

$ uname -a
FreeBSD n54l 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC  amd64

$ cat FreeBSD.conf 
# $FreeBSD: releng/12.0/usr.sbin/pkg/FreeBSD.conf 340161 2018-11-05 21:28:32Z gjb $
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:
#
#   mkdir -p /usr/local/etc/pkg/repos
#   echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#

FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
$
```


----------



## Vull (Feb 18, 2019)

I've been using FreeBSD-12.0-RELEASE-p3, with various plasma5 versions up to and including 5.14.5_1 from both ports and packages, and have had no serious memory usage problems with any of it. Also, since kde4, which seemed to require `hald_enable="YES"` in /etc/rc.conf, I never enable the HAL daemon for plasma5, but instead, for automounting my USB drives, I use sysutils/automount for packages, or the build option BSDISKS for ports.

On FreeBSD-12.0-RELEASE I have to install sysutils/automount version 1.6.0 or higher, instead of the package version, which is still stuck on version 1.5.8. Automount version 1.6.0 or 1.6.1 can be downloaded and easily installed from here: https://github.com/vermaden/automount

Firefox is my biggest memory user so I monitor it with `top`, and have to restart it occasionally. Here's my present top summary:
	
	



```
last pid: 19356;  load averages:  1.51,  1.56,  1.00     up 1+09:15:48  14:49:51
67 processes:  1 running, 66 sleeping
CPU:  1.2% user,  0.0% nice,  0.0% system,  0.0% interrupt, 98.8% idle
Mem: 410M Active, 1436M Inact, 214M Laundry, 228M Wired, 83M Buf, 702M Free
Swap: 5953M Total, 8944K Used, 5945M Free
```


----------



## mickey (Feb 19, 2019)

Just yesterday I was experiencing this issue also. Lots of messages on the console about getswapspace failed. This is on a FreeBSD 12.0-RELEASE-p3 amd64 system, ZFS, everything built from sources (base system, custom kernel, ports, no pkgs) with plasma5-plasma-5.15.0 and nvidia-driver-390.87_2. Strange thing is, when I became aware of the problem, only 1% of the available swap space (4 GiB swap / 16 GiB RAM) was in use and I did not see any ill effects either. I then replaced my tmpfs(5) /tmp filesystem with a ZFS dataset, rebuilt/installed kernel and nvidia-driver and so far I have not encountered the problem again since then. Lets hope it stays that way


----------



## rsronin (Feb 19, 2019)

> I just reinstalled FreeBSD-12-RELEASE and gave it 8GB of dedicated swapspace. On purpose I did *not upgrade to p3* (freebsd-update fetch and freebsd-update install). Neither did I use the latest pkg repo, but the quarterly one. For the time being it works now but scared to upgrade.



So I upgrade to FreeBSD-12.0-RELEASE-p3 and switched to the 'latest' pkg repo. No problem with swapspace , but plasma5/kwin_X11 hangs and I am not able to use the desktop, just a black screen, an empty panel and a mousepointer. The hardware is an HP Microserver n54l with an Nvidia GT710 card. I can not check the other plasma5 installation on my Thinkpad T430 anymore because I had to sent it back for an RMA.


----------



## Vull (Feb 19, 2019)

rsronin said:


> So I upgrade to FreeBSD-12.0-RELEASE-p3 and switched to the 'latest' pkg repo. No problem with swapspace , but plasma5/kwin_X11 hangs and I am not able to use the desktop, just a black screen, an empty panel and a mousepointer. The hardware is an HP Microserver n54l with an Nvidia GT710 card. I can not check the other plasma5 installation on my Thinkpad T430 anymore because I had to sent it back for an RMA.


Ouch. If you switch your console to ttyv0 with the CTRL-ALT-F1 key combination, are there any interesting messages displayed there? (You should be able to get back to the desktop with CTRL-ALT-F9 as you probably know.) Before regressing back to a previous configuration, you might want to log in on another virtual terminal and inspect your messages with `dmesg -a` and also check out the contents of the /var/log/Xorg.0.log file.

I'm assuming you have `dbus_enable="YES"` in your /etc/rc.conf file. Are you using sddm or some other login manager? Before giving up on this configuration, I'd consider disabling the login manager in rc.conf and rebooting (`sddm_enable="NO"`). Then you could login as your non-root user and create an .xinitrc file in the non-root user's home directory, with the contents `exec ck-launch-session startkde` -- and then after that, you could try again to start X by entering the `startx` command on that non-root user's terminal, and see all the X feedback messages as they occur, in the hope of debugging the problem. It would be better to do this remotely via ssh from another computer with a GUI terminal and scrollback feature, but since your Thinkpad is in the shop you might need to do it from another virtual terminal. Sorry if I led you into this by suggesting that the upgrade wouldn't cause any problems but I really didn't think that it would. And thanks anyway for keeping us up to date on your results.


----------



## mickey (Feb 19, 2019)

rsronin said:


> So I upgrade to FreeBSD-12.0-RELEASE-p3 and switched to the 'latest' pkg repo. No problem with swapspace , but plasma5/kwin_X11 hangs and I am not able to use the desktop, just a black screen, an empty panel and a mousepointer. The hardware is an HP Microserver n54l with an Nvidia GT710 card. I can not check the other plasma5 installation on my Thinkpad T430 anymore because I had to sent it back for an RMA.


Try reinstalling the nvidia-driver and see if that helps. You might also want to try and build it from ports instead of using the package.


----------



## rsronin (Feb 19, 2019)

Vull said:


> Ouch. If you switch your console to ttyv0 with the CTRL-ALT-F1 key combination, are there any interesting messages displayed there? (You should be able to get back to the desktop with CTRL-ALT-F9 as you probably know.) Before regressing back to a previous configuration, you might want to log in on another virtual terminal and inspect your messages with `dmesg -a` and also check out the contents of the /var/log/Xorg.0.log file.
> 
> I'm assuming you have `dbus_enable="YES"` in your /etc/rc.conf file. Are you using sddm or some other login manager? Before giving up on this configuration, I'd consider disabling the login manager in rc.conf and rebooting (`sddm_enable="NO"`). Then you could login as your non-root user and create an .xinitrc file in the non-root user's home directory, with the contents `exec ck-launch-session startkde` -- and then after that, you could try again to start X by entering the `startx` command on that non-root user's terminal, and see all the X feedback messages as they occur, in the hope of debugging the problem. It would be better to do this remotely via ssh from another computer with a GUI terminal and scrollback feature, but since your Thinkpad is in the shop you might need to do it from another virtual terminal. Sorry if I led you into this by suggesting that the upgrade wouldn't cause any problems but I really didn't think that it would. And thanks anyway for keeping us up to date on your results.



Yes, I always have `dbus_enable="YES"` in /etc/rc.conf file, not using hald_enable and for mounting USB drives I use sysutils/dsbmc/. Last weekend I already had this problem and I tried to ssh into the machine but it was not responding.

In the meantime I did:

`sudo freebsd-update fetch
sudo freebsd-udate install`

and because I switched to the latest pkg repo:

`sudo pkg update -f
sudo pkg upgrade -fy`


And yes I was using x11/sddm to login and start the desktop. It resulted in an unresponsive desktop (wallpaper and panel visible this time after a long wait) and a lot of disk activity. I switched to ttyv0 with the CTRL-ALT-F1 and again there were those messages: swap_pager_getswapspace: failed. Also messages that processes were killed (plasmashell, kwin_X11 etc.) I checked with top and only 22mb of 8125mb of swapspace was used.

I will try the `startx` route with .xinitrc


----------



## rsronin (Feb 19, 2019)

mickey said:


> Try reinstalling the nvidia-driver and see if that helps. You might also want to try and build it from ports instead of using the package.


I would love to go to ports only, last year and my first FreeBSD year, I learned not to mix pkg and ports ;-)
Also wondering how many hours it will take to compile all those packages on an old thinkpad or even worse the hp microserver, apart from me setting up poudriere.


----------



## rsronin (Feb 19, 2019)

rsronin said:


> I will try the  startx route with .xinitrc


I just tested it and after a very long wait I am able the use the desktop again. Thanks!


----------



## Vull (Feb 19, 2019)

You're welcome. It took me about 5-6 days to build the following ports on a Dell Dimension 4700... I don't mind so much since I do have a laptop I can use while it's compiling everything.

3|databases/postgresql11-server
4|x11/plasma5-plasma|DISABLE_VULNERABILITIES=yes
5|x11/xorg
6|x11/konsole
7|x11-fm/dolphin|DISABLE_VULNERABILITIES=yes
8|math/kcalc
9|www/firefox|DISABLE_VULNERABILITIES=yes
A|x11/sddm
B|graphics/gwenview
C|graphics/spectacle
D|editors/vim
E|www/apache24
F|lang/php73
G|databases/php73-pgsql
H|www/mod_php73
I|textproc/php73-ctype
J|ftp/php73-ftp
K|converters/php73-mbstring
L|textproc/php73-xml
M|databases/phppgadmin
N|editors/libreoffice|DISABLE_VULNERABILITIES=yes
O|graphics/gimp|DISABLE_VULNERABILITIES=yes
R|multimedia/vlc|DISABLE_VULNERABILITIES=yes

My main reason for using ports is to get php version 7.3 to work with postgresql version 11. Also for learning purposes, to learn how to use ports. The only other thing I changed was enabling BSDISKS option in the kf5-solid port, for mounting USBs in plasma5 desktop. You might get some benefit from compiling your nvidia driver from ports, as Mickey suggested above. I'm not at all sure about it, but I somewhat doubt that this would be an area where mixing ports and packages would be a problem.

If you decide to reinstall (as I often do) you might try upgrading to 12.0-RELEASE-p3 first, and then install the desktop from packages afterwards. I'm guessing that your problem might have started with using the -f option in your pkg upgade command -- I've never used that option out of my own fear uncertainty and doubts about it.


----------



## rsronin (Feb 19, 2019)

So I was cheering to soon. I'm using another laptop reading and writing here. I just switched to the hp microserver and checked top. Swap space was almost completely used and then I switched to the desktop which was not responding and colors where fading. Switched back to top and all the swap space was consumed by xorg and then it crashed.


----------



## Vull (Feb 19, 2019)

Something seems to be gobbling up your memory. I wonder what would happen if you disabled the nvidia driver and tried again? I don't have an nvidia card and have no idea if X would even be able to start without it, but it probably wouldn't hurt to give it a try, and it might help to narrow down the possibilities of what's causing this problem. My system has intel graphics so I don't really need any extra video drivers and don't use any.


----------



## mickey (Feb 19, 2019)

From my own experience, the nvidia-driver seems to be a picky thing, that does not really like it to not be in sync with the current kernel. The other day I ran buildworld/buildkernel to upgrade from 12.0-p2 to 12.0-p3 and did not think about reinstalling the nvidia-driver afterwards at first. Only after I was experiencing some issues, namely slideshow like video when playing back using vdpau, I went about reinstalling the driver from ports. Since then everything has been fine again. As a bonus when building nvidia-driver from ports you get to disable linux compat, in case you wont need it, also I dont see any problem mixing it with packages as no other package should have a runtime dependency on nvidia-driver.


----------



## rsronin (Feb 19, 2019)

mickey said:


> From my own experience, the nvidia-driver seems to be a picky thing, that does not really like it to not be in sync with the current kernel. The other day I ran buildworld/buildkernel to upgrade from 12.0-p2 to 12.0-p3 and did not think about reinstalling the nvidia-driver afterwards at first. Only after I was experiencing some issues, namely slideshow like video when playing back using vdpau, I went about reinstalling the driver from ports. Since then everything has been fine again. As a bonus when building nvidia-driver from ports you get to disable linux compat, in case you wont need it, also I dont see any problem mixing it with packages as no other package should have a runtime dependency on nvidia-driver.


So I builded the nvidia-driver from the ports, disabling linux compat.
Unfortunately same results, after startx it takes a long time before the desktop is showing and although there is a ;panel and a mousepointer it is unusable. I was able to ssh and run top and this is what is shows:


```
Mem: 2615M Active, 3844K Inact, 819M Laundry, 459M Wired, 211M Buf, 22M Free
Swap: 8285M Total, 6644M Used, 1641M Free, 80% Inuse, 76K In, 72M Out

  PID USERNAME    THR PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
1182 amw          10  21    0   224G  3470M uwait    1   0:15   3.46% plasmashell
1178 amw           7  20    0   342M    76M select   0   0:08   0.52% kwin_x11
1165 amw           6  20    0   175M    63M select   1   0:02   0.47% kded5
1211 amw           3  20    0   155M    59M select   0   0:02   0.46% kmix
1095 amw           1  20    0    13M  3380K CPU1     1   0:01   0.06% top
1325 amw           1  20    0    13M  3812K CPU0     0   0:00   0.04% top
  711 root          1  20    0    10M  1140K select   0   0:00   0.02% devd
1120 polkitd      10  20    0  1105M    15M select   0   0:00   0.02% polkitd
1118 root         15  20    0    35M  6436K swread   0   0:00   0.02% console-kit-daemon
1114 amw           1  27    0  6265M    55M select   1   0:17   0.02% Xorg
  967 ntpd          1  20    0    18M    18M select   1   0:00   0.01% ntpd
  786 root          1  20    0    11M  2104K select   1   0:00   0.01% syslogd
  994 root          2  20    0    15M  3068K select   0   0:01   0.01% dsbmd
1190 root          3  20    0    24M  6464K select   1
```


----------



## rsronin (Feb 20, 2019)

Changed the plasma theme to the default 'breeze' and now everything is fine...
The culprit seemed to be the plasma theme 'produkt blue'.



```
last pid:  1391;  load averages:  0.39,  0.40,  0.22                                                                                                                 up 0+00:09:03  10:52:47
67 processes:  1 running, 66 sleeping
CPU:  1.2% user,  0.0% nice,  0.4% system,  0.4% interrupt, 98.0% idle
Mem: 893M Active, 357M Inact, 37M Laundry, 716M Wired, 384M Buf, 1913M Free
Swap: 8285M Total, 8285M Free

  PID USERNAME    THR PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
1325 amw           3  20    0   167M   132M select   1   0:03   1.04% konsole
1229 amw           3  20    0   157M    70M select   1   0:02   0.46% kmix
1297 amw           7  20    0   175M   106M select   0   0:02   0.44% kded5
1127 amw           1  20    0  6261M    64M select   0   0:25   0.42% Xorg
1196 amw           8  20    0   375M   119M select   0   0:18   0.07% kwin_x11
1330 amw           1  20    0    13M  3944K CPU0     0   0:00   0.06% top
1331 amw          20  20    0   485M   256M select   0   0:17   0.03% chrome
1345 amw           7  20    0   399M   199M select   1   0:09   0.01% chrome
  999 root          2  20    0    15M  4600K select   1   0:01   0.01% dsbmd
1382 amw           9  20    0   437M   167M uwait    1   0:00   0.00% chrome
  972 ntpd          1  20    0    18M    18M select   1   0:02   0.00% ntpd
1027 root          1  20    0    17M  7660K select   0   0:00   0.00% sendmail
1381 amw          12  20    0   538M   244M uwait    1   0:23   0.00% chrome
1201 amw          12  20    0   479M   300M select   0   0:11   0.00% plasmashell
1383 amw           7  20    0   433M   226M select   1   0:03   0.00% systemsettings5
1372 amw           9  20    0   513M   206M uwait    0   0:02   0.00% chrome
1371 amw          11  20    0   488M   185M uwait    1   0:01   0.00% chrome
  661 root          1  20    0    11M  2432K select   0   0:01   0.00% moused
1199 amw           5  20    0   202M    77M select   1   0:01   0.00% krunner
1375 amw          10  20    0   473M   168M uwait    1   0:01   0.00% chrome
1188 amw           3  20    0   154M    63M select   1   0:00   0.00% ksmserver
1377 amw           9  20    0   465M   178M uwait    1   0:00   0.00% chrome
1178 amw           3  20    0   144M    58M select   0   0:00   0.00% kglobalaccel5
1163 amw           4  20    0   144M    56M select   1   0:00   0.00% klauncher
1216 amw           6  20    0   141M    61M select   1   0:00   0.00% org_kde_powerdevil
1205 amw           5  20    0   150M    60M select   0   0:00   0.00% polkit-kde-authenti
1170 amw           3  20    0   143M    57M select   0   0:00   0.00% kaccess
1374 amw           9  20    0   457M   158M uwait    0   0:00   0.00% chrome
1294 amw           3  20    0   144M    90M select   0   0:00   0.00% kuiserver5
1226 amw           7  20    0   132M    49M select   1   0:00   0.00% kactivitymanagerd
1150 amw           1  20    0    12M  3912K select   1   0:00   0.00% dbus-daemon
1162 amw           1  20    0   122M    48M select   0   0:00   0.00% kdeinit5
1133 polkitd      10  20    0  1105M    22M select   1   0:00   0.00% polkitd
1207 amw           3  20    0   105M    37M select   1   0:00   0.00% xembedsniproxy
1184 amw           1  20    0    13M  3900K ttyin    0   0:00   0.00% top
1209 amw           4  20    0   108M    38M select   0   0:00   0.00% gmenudbusmenuproxy
1264 amw           3  20    0    98M    35M select   0   0:00   0.00% kscreen_backend_lau
  710 root          1  20    0    10M  1472K select   1   0:00   0.00% devd
1131 root         15  20    0    35M  7584K select   1   0:00   0.00% console-kit-daemon
  928 messagebus    1  20    0    13M  3876K select   0   0:00   0.00% dbus-daemon
  785 root          1  20    0    11M  2652K select   0   0:00   0.00% syslogd
1258 root          3  20    0    24M  7068K select   0   0:00   0.00% upowerd
1096 amw           1  20    0    20M  9732K select   1   0:00   0.00% sshd
```


----------



## doctorlouie (Apr 2, 2020)

My "swap_pager_getswapspace: failed" issue was borne from my having improperly handled QoS on the server. More so, considering there are applications I wrote requiring multi-connection mitigation for crawlers and bots.

To find the source of the problem I simply ran:


```
top -Cawores
```

The problem, turns out, would be within a hosted web server application. Looked at the web server logs to find the source of the problem. Added mod_qos, should fix the problems with QoS and swap space mismanagement on my behalf.


----------

