Description

This article describes the common causes and validation steps for high swap memory usage on vSRX firewalls. High swap utilization may lead to performance degradation and system instability.

Symptoms

Devices experiencing high swap usage may show the following symptoms:

  • Slow or delayed CLI response
  • Longer commit times
  • Unexpected device crashes or reboots

Solution

While there are several generic reasons for swap usage on vSRX devices, the most commonly observed causes include:

  1. Frequent automatic configuration backups
    Continuous backup operations consume memory resources and can increase swap usage.

  2. Frequent SNMP polling of large dataset
    Large or repeated SNMP queries—especially from monitoring tools—can push the system to use swap memory.

  3. Polling using show version detail
    Fetching show version detail frequently consumes more memory;
    Use show version instead for lightweight polling.

 

How to Verify Swap Usage


1. Check Swap Usage from Junos CLI

> show system processes extensive | match swap
Swap: 1024M Total, 768M Used, 256M Free, 75% Inuse

2. Check Swap Usage from Shell

start shell
# swapinfo
Device          1K-blocks     Used    Avail Capacity
/dev/gpt/swap     1048576   786588   261988    75%


Important Behavior to Understand
Swap memory not being released immediately is expected behavior on Linux-based systems (including vSRX).
What matters is whether the swap is actively being used (swap-in/out activity).

Check Real-time Swap Activity Using vmstat
Run the following command from the shell:

#vmstat 1

Focus on:
pi (page-in)
po (page-out)

If both values stay near 0, it means the system is not actively swapping, even if swap usage appears high.

Example:
# vmstat 1
procs  memory       page                    disks     faults         cpu
r b w  avm   fre   flt  re  pi  po    fr   sr md0 md1   in    sy    cs us sy id
2 0 0 7.4G   90M   484   0   0   0   472   63   0   0    3  7566  1980 51  1 48
1 0 0 7.4G   90M     1   0   0   0     0   77   0   0    4  5675  1869 50  1 49
6 0 0 7.4G   90M   503   0   0   0   572   70   0   0    2  6547  1883 50  1 49
6 0 0 7.4G   90M     2   0   0   0     0   70   0   0    2  5683  1901 50  1 49
6 0 0 7.4G   90M     2   0   0   0     0   70   0   0    0  5801  1914 51  2 48
7 0 0 7.4G   90M     0   0   0   0     0   70   0   0    1  5784  1863 51  0 49
7 0 0 7.4G   90M     0   0   0   0     0   70   0   0    0  6359  1921 51  0 49
7 0 0 7.4G   90M   536   0   0   0   572   70   0   0    0  6417  1874 50  0 49
7 0 0 7.4G   90M     0   0   0   0     0   70   0   0    1  5696  1897 50  2 48

 

 

Modification History

2026-01-20 : Article Created