Description

This KB explains the meaning of the continuous log message "Percentage memory available(19)less than threshold(20 %)" with an example of memory calculation.

Symptoms

Below continuous logs will be seen on the device :-

May  5 21:51:10  device /kernel: %KERN-4: Percentage memory available(19)less than threshold(20 %)- 13012
May  5 21:51:25  device /kernel: %KERN-4: Percentage memory available(19)less than threshold(20 %)- 13013
May  5 21:52:35  device /kernel: %KERN-4: Percentage memory available(19)less than threshold(20 %)- 13014
May  5 21:53:45  device /kernel: %KERN-4: Percentage memory available(19)less than threshold(20 %)- 13015
May  5 21:54:50  device /kernel: %KERN-4: Percentage memory available(19)less than threshold(20 %)- 13016
May  5 21:56:00  device /kernel: %KERN-4: Percentage memory available(18)less than threshold(20 %)- 13017
May  5 21:57:11  device /kernel: %KERN-4: Percentage memory available(19)less than threshold(20 %)- 13018
May  5 21:58:16  device /kernel: %KERN-4: Percentage memory available(18)less than threshold(20 %)- 13019
May  5 21:58:51  device /kernel: %KERN-4: Percentage memory available(19)less than threshold(20 %)- 13020
May  5 21:59:31  device /kernel: %KERN-4: Percentage memory available(19)less than threshold(20 %)- 13021

Solution

The logs indicate that the available memory is 19% which is less than the threshold defined in software which is 20%.
 
Memory in use and available memory Calculation with an Example:
Total RAM: 1920 MB
user@device> show chassis routing-engine no-forwarding
Routing Engine status:
 Slot 0:
  Current state          Master
  Temperature            34 degrees C / 93 degrees F
  CPU temperature        34 degrees C / 93 degrees F
  DRAM                   1920 MB>>>>>>>>>>>>>>>>>>>>>>>>>>>> Total RAM.
  Memory utilization     73 percent

Free memory from is sum of inactive, cache and free:
user@device> show system processes extensive no-forwarding
 
last pid: 11383; load averages: 0.79, 0.74, 0.63 up 0+03:10:32  10:28:57
181 processes: 4 running, 157 sleeping, 20 waiting
 
Mem: 905M Active, 114M Inact, 485M Wired, 341M Cache, 69M Buf, 3744K Free
Swap: 1106M Total, 1106M Free
 
Total Free(Available memory): 114+341+3.7=458.7 M

Memory Calculation:

Memory in use [(Total RAM-Total Free)/Total RAM]*100 :-  [1920-458.7)(/1920]*100  ~76%

Conclusion:
  • When above[Memory in use] goes beyond 80%, logs are generated .
  • However these logs  are not directly related to an issue on the device and those are only an indication of available memory with respect to threshold defined in the Junos software.
  • Other than free, cache, inactive memory devices have swap memory available to use when there is a memory crunch on the device.
  • In case of a temporary memory crunch, the device still has can use of swap memory if available & the device functions would not be impacted.
  • This continuous memory threshold logs from kernel can be due to multiple reason; one of which can be execution of multiple cli commands in a short span of time. This is directly related to the amount of parallel cli processes getting spawned and getting used at any time leaving available memory less than 20% that triggers the above message.
  • EX4300, EX4600 & QFX5100:

Modification History

2023-09-06: Formatting and correction done
2024-Oct-06: Added DRAM behaviour for EX4300, EX4600 & QFX5100 on latest Junos