Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

Syslog message: 'kernel: %KERN-2: swap_pager_getswapspace(3): failed'



Article ID: KB36375 KB Last Updated: 25 Dec 2020Version: 1.0

On a Junos device facing a memory-related issue, the following message is seen: 

kernel: %KERN-2: swap_pager_getswapspace(3): failed

This article explains the meaning of this syslog message and provides troubleshooting tips.

  • High memory usage on the Juniper device.
  • Slow CLI access over SSH session to the device.
  • Route protocol flaps/instability of the routing protocol neighbors/issues with routing table entries and packet forwarding.
  • Memory leak where an application used some memory and after it is done using this memory, did not release it to be re-used.
  • Some genuine application utilizing higher memory as per it's needs.
  • Large chunks of inactive memory

Swap memory is a form of virtual memory which is used when an application does not get access to as much physical memory as it needs.  Swap memory is seen as a last resort by the application. Seeing high usage of swap memory is an indication of the system not being healthy memory-wise.

Extended high usage of swap memory can result in the swap operation (attempt by the application to access swap memory) failing. In this case, the following message would be seen:

kernel: %KERN-2: swap_pager_getswapspace(3): failed

Use the commands below to view the current usage of swap memory. Additional pointers can be obtained from the output below regarding the cause behind the swap memory usage. 
Note: Swap memory is often the victim and not the cause of the problem. Try to isolate the reason behind the usage of swap memory.
show system processes extensive 
last pid: 76305;  load averages:  0.29,  0.26,  0.23  up 12+08:40:01    00:33:38
370 processes: 5 running, 337 sleeping, 28 waiting

Mem: 99M Active, 3663M Inact, 921M Wired, 492M Buf, 11G Free
Swap: 8192M Total, 8192M Free   <-- Notice the usage of swap here. In this case, swap memory is not being used.

   11 root     155 ki31     0K    64K CPU2    2 292.9H 100.00% idle{idle: cpu2}
   11 root     155 ki31     0K    64K CPU3    3 292.9H 100.00% idle{idle: cpu3}
   11 root     155 ki31     0K    64K CPU0    0 292.4H 100.00% idle{idle: cpu0}
   11 root     155 ki31     0K    64K RUN     1 292.9H  99.27% idle{idle: cpu1}
10410 root      21    0  1459M   663M nanslp  1 680:29   3.17% chassisd 
76303 labroot   21    0 88252K 44196K select  3   0:00   1.27% cli
10431 root      20    0   727M 13272K select  0  30:57   0.00% clksyncd
10551 root      20    0   900M 44620K nanslp  1  15:40   0.00% rep-serverd
10550 root      20    0   900M 44616K nanslp  3  15:27   0.00% rep-clientd

show system virtual-memory | match swap 
         SWAP     2  1097K       -        2  64
SWAPMETA:        288,  2034318,       0,      0,        0
        0 swap pager pageins
        0 swap pager pages paged in
        0 swap pager pageouts
        0 swap pager pages paged out

After isolating an application that is consuming higher memory, try to isolate the reason behind that or reach out to JTAC to validate your findings and get a recommendation if restarting that application would help. In many cases, where the existing physical memory on the device is less than what is required, as a last resort an upgrade would be needed in order for the hardware and software to increase available memory for the system.

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search