docker stats memory usage shows memory.current - inactive_file
cat /sys/fs/cgroup/memory.stat | grep inactive_filethis fn shows real PHP mem usage including inactive_file:
private static function getMemoryUsage(): int {
$status = @file_get_contents('/proc/self/status');
if ($status !== false && preg_match('/VmRSS:\s+(\d+)\s+kB/', $status, $matches)) {