/usr/bin/paddrspacesize is in hxtools 20170430-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #!/usr/bin/perl
#
# Print size of adress space
# written by Jan Engelhardt, 2007
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the WTF Public License version 2 or
# (at your option) any later version.
#
use strict;
local *FH;
print "#### This script uses a heuristic, so may not be accurate\n";
my @list = `ps afhx -o pid,command`;
foreach my $line (@list) {
my($pid, $reset) = ($line =~ /^\s*(\d+)\s+(.*)/);
my $bitness = 0;
if (!open(FH, "</proc/$pid/maps")) {
next;
}
while (defined(my $subline = <FH>)) {
$subline =~ /^([0-9a-f]+)/i;
if ($bitness < length($1)) {
$bitness = length($1);
}
}
printf "[%2s] %s", $bitness == 0 ? "--" : 4 * $bitness, $line;
close FH;
}
|