<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
I've ran into an issue on a device which runs out of memory, but it refuses to panic on OOM.  This creates a DOS affect.  No SSH to the device, but I am still able to ping it. After reboot messages in syslog show the device has ran out of memory.  Kernel is
 2.,6.38 and system is 32bit.<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
I followed instructions on the URL below to test OOM panic.  I compiled an ran the program to test.  On a system with kernel 5.6.0 the OOM panics and system is restarted.  It works, but on the problem device it is as if the OOM is not fully aware. free, /proc/meminfo,
 vmstat, etc do not show memory usage skyrocketing as it does on the other system.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Free on the problem device before I run the program:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: "Courier New", monospace;">[root@basement]# free</span>
<div><span style="font-family: "Courier New", monospace;">             total       used       free     shared    buffers cached</span></div>
<div><span style="font-family: "Courier New", monospace;">Mem:       1964728     235380    1729348          0      12064  55388</span></div>
<div><span style="font-family: "Courier New", monospace;">-/+ buffers/cache:     167928    1796800</span></div>
<div><span style="font-family: "Courier New", monospace;">Swap:            0          0          0</span></div>
<br>
Now, I run it and it is able to allocate 82 chunks at 10M each before malloc() failed:<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: "Courier New", monospace;">[root@basement]#  oom</span><br>
<div><span style="font-family: "Courier New", monospace;">Allocated 82 chunks.</span></div>
<div><span style="font-family: "Courier New", monospace;">Sleeping 60(s) before exiting.</span></div>
<div><br>
</div>
<div>In another xterm I'll run free while oom is waiting to exit.  Once it exits, all that memory is freed. No change.<br>
</div>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace;">[root@basement]# free</span>
<div><span style="font-family: "Courier New", monospace;">             total       used       free     shared    buffers cached</span></div>
<div><span style="font-family: "Courier New", monospace;">Mem:       1964728     236380    1728348          0      12112  55388</span></div>
<div><span style="font-family: "Courier New", monospace;">-/+ buffers/cache:     168880    1795848</span></div>
<div><span style="font-family: "Courier New", monospace;">Swap:            0          0          0</span></div>
</div>
<div><br>
</div>
<div>If I run oom in another window it will only grab 2 chunks before failure.  Also, watchdog is configured to restart if it can't allocate 20M of memory.  Watchdog will restart the device because it is unable to grab it.</div>
<div><br>
</div>
The system itself has 2G of RAM.  <br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
If that program was able to allocate 82x10 820M of RAM why did that not show up as used memory?  Now, I'm curious as to why Iw as only able to allocate 830M if there is 1.7GB free? 
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Below is grep 'MEM' config:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: "Courier New", monospace;"># CONFIG_CGROUP_MEM_RES_CTLR is not set</span>
<div><span style="font-family: "Courier New", monospace;">CONFIG_SHMEM=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_NO_BOOTMEM=y</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_MEMTEST is not set</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_NOHIGHMEM is not set</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_HIGHMEM4G=y</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_HIGHMEM64G is not set</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_HIGHMEM=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_ARCH_FLATMEM_ENABLE=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_ARCH_SPARSEMEM_ENABLE=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_ARCH_SELECT_MEMORY_MODEL=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_SELECT_MEMORY_MODEL=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_FLATMEM_MANUAL=y</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_SPARSEMEM_MANUAL is not set</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_FLATMEM=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_FLAT_NODE_MEM_MAP=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_SPARSEMEM_STATIC=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_HAVE_MEMBLOCK=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_MEMORY_FAILURE is not set</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_BLK_DEV_UMEM is not set</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_INPUT_FF_MEMLESS=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_DEVKMEM=y</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_FIX_EARLYCON_MEM=y</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_HW_RANDOM_TIMERIOMEM is not set</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_MEMSTICK is not set</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_FIRMWARE_MEMMAP=y</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_DEBUG_KMEMLEAK is not set</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_DEBUG_HIGHMEM is not set</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_DEBUG_MEMORY_INIT is not set</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_HAVE_ARCH_KMEMCHECK=y</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_STRICT_DEVMEM is not set</span></div>
<div><span style="font-family: "Courier New", monospace;">CONFIG_ASYNC_MEMCPY=y</span></div>
<span style="font-family: "Courier New", monospace;">CONFIG_HAS_IOMEM=y</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Also:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span style="font-family: "Courier New", monospace;">CONFIG_VMSPLIT_3G=y                                                              </span>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_VMSPLIT_3G_OPT is not set                                              
</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_VMSPLIT_2G is not set                                                  
</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_VMSPLIT_2G_OPT is not set                                              
</span></div>
<div><span style="font-family: "Courier New", monospace;"># CONFIG_VMSPLIT_1G is not set                                                  
</span></div>
<span style="font-family: "Courier New", monospace;">CONFIG_PAGE_OFFSET=0xC0000000  </span>    
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
</div>
</body>
</html>