I am running SQL Server 2019 CU15 on Linux in kubernetes and trying to investigate why SQL Server pod gets killed by OOMKiller. I see some inconsistency in reporting of memory consumption. SQL Server POD has a limit of 16 Gigs of RAM (both as a limit and as a startup argument) now and only 14000 as Max Server Memory. Currently Target Server Memory is reported as 11397920 Kb, which is aligned with what I get from memory clerks by summing up. So inside of SQL Server it all looks consistent. If I query sys.dm_os_process_memory then virtual_address_space_committed_kb equals to 11410248 which is almost the same number. But I can't get that order of number from OS level by any means. I am using image from Microsoft, so I cannot add anything for extended diag. RSS value in ps shows 15 gigs. same is for top. I have a gut feeling that this difference is exactly what crosses the limit and causes OOMKiller to kill the pod. Knee-jerk would be to add this gap to any SQL Server pod's limit while keeping max server memory the same. But I still want to have an understanding of what is that extra mem used for and how to track it internally?
$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
1000630+ 7 0.0 0.0 61636 23524 ? Sl Aug03 0:00 /opt/mssql/bin/sqlservr
1000630+ 9 26.9 11.4 278592548 15122076 ? Sl Aug03 12325:54 /opt/mssql/bin/sqlservr
1000630+ 400010 0.0 0.0 2628 544 pts/0 Ss 11:15 0:00 sh -i -c TERM=xterm sh
1000630+ 400016 0.0 0.0 2628 548 pts/0 S 11:15 0:00 sh
1000630+ 400019 0.0 0.0 6192 3388 pts/0 S+ 11:15 0:00 top
1000630+ 400254 0.0 0.0 2628 612 pts/1 Ss 11:42 0:00 sh -i -c TERM=xterm sh
1000630+ 400260 0.0 0.0 2628 612 pts/1 S 11:42 0:00 sh
1000630+ 400262 0.0 0.0 6192 3296 pts/1 S+ 11:42 0:00 top
1000630+ 400880 0.0 0.0 2628 544 pts/2 Ss 12:51 0:00 sh -i -c TERM=xterm sh
1000630+ 400886 0.0 0.0 2628 544 pts/2 S 12:51 0:00 sh
1000630+ 400954 0.0 0.0 5912 2904 pts/2 R+ 12:59 0:00 ps aux