Skip to content
Smarter by Design.Simpler for Business

sys-cmd memory free-swap ​

sys-cmd memory free-swap turns off the swap area in WEB-CLI and moves all the pages in it to memory, and then re-enables the swap area. It is used to take back into memory the pages that fell into swap during a past load and stayed there.

Command Summary ​

TR7 WEB-CLI · sys-cmd memory free-swap
admin@TR7LBWAF01> sys-cmd memory free-swap
⚠  You are about to clear swap space
    This will move all swap contents to RAM and re-enable swap. The system may become unstable if there is not enough free RAM.
 
Type "yes" to confirm: yes
Swap space cleared and re-enabled successfully.
admin@TR7LBWAF01>  

The command has no field or parameter. When it is run, the confirmation screen opens; when evet is written in the Turkish interface and yes in the English interface, the operation is applied. If anything else is written, the Invalid confirmation. Operation cancelled. message appears; Esc closes the confirmation screen.

The free memory is checked first

Everything in swap is moved to memory. If in the memory status output the Mem row's available value is not noticeably greater than the Swap row's used value, the command is not run; otherwise the memory runs out and services can be terminated.

How It Works ​

SubjectBehavior
ContextIt is not affected by the selected v-device and route table; it always runs on the device itself.
DurationIt depends on the amount of data in swap; while a few gigabytes of swap is being emptied it can take minutes, and during this time the device may slow down.
The result messageWhen the work finishes, Swap space cleared and re-enabled successfully. is written. This message is written without looking at the exit status of the operation; if there is a red line above it, swap may not have been turned off or re-enabled, and the state is verified with memory status.
RecordingEvery run is written to the user logs.

The Safe Order of Use ​

TR7 WEB-CLI · the free-swap order
# 1) is available greater than the swap used value
admin@TR7LBWAF01> sys-cmd memory status
# 2) empty swap at a moment that is not busy
admin@TR7LBWAF01> sys-cmd memory free-swap
# 3) has the Swap used value dropped to zero, is swap enabled again
admin@TR7LBWAF01> sys-cmd memory status
admin@TR7LBWAF01>  

Things to Know ​

  • It is not run during busy hours. While the operation continues, the disk and memory load increases.
  • It is not a permanent solution. If swap fills up often, the memory of the device is not enough for the workload; the cache and swap operations only provide temporary relief.
  • The swap size does not change. The command only empties the content; the size of the swap area stays the same.