[Bug 256507] Apparent kernel memory leak in 12-STABLE/13.1-Release

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 25 Aug 2022 16:16:14 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256507

--- Comment #12 from dave@jetcafe.org ---
So...stopping -all- running services to me is an effective reboot. :)

Nevertheless, on my machine with the most minimal service deployment that has
the memory issue, I stopped the biggest memory consumers:

  unbound
  node_exporter
  blackbox_exporter

Stopping them did not return the memory, as measured by this script:

--Begin script
#!/usr/local/bin/perl
use strict;
use warnings;

my $pagesize = `sysctl -n vm.stats.vm.v_page_size`; chomp($pagesize);

my %db = ();
open(STATS,"sysctl vm.stats.vm |") || die "Can't open sysctl: $!\n";
while(<STATS>) {
  if (/v_(\S+)_count:\s(\d+)/) {
     $db{$1} = $2;
  }
}
close(STATS);

my $total = $db{'page'};
foreach my $k (keys %db) {
   next if ($k eq 'page');
   $total -= $db{$k};
}

my $totalmemMB = ($pagesize * $total) / (1024 * 1024);
printf("Lost memory: %d %d-byte pages (%.f MB)\n", $total, $pagesize,
$totalmemMB);
--- End script

This printed out roughly the same numbers as reported by prometheus after
services were stopped.

Of course, I have superpages enabled and yet vm.stats.vm.v_page_size reports
4096 still. I've no idea if this is the correct way to calculate actual memory
lost, but it looks correct.

-- 
You are receiving this mail because:
You are the assignee for the bug.