fixed a bad memory scaling in *BSD systems

This commit is contained in:
Jordi Sanfeliu 2017-09-29 12:29:07 +02:00
parent ef11f447fb
commit 622289f9d9
2 changed files with 2 additions and 0 deletions

View File

@ -3,6 +3,7 @@
- Added a new option called 'graph_mode' to view the memory graph in two
different modes: 'real' (being the default) and 'interpreted'.
(suggested by Łukasz "Cyber Killer" Korpalski, cyberkiller8 AT gmail.com)
- Fixed a bad memory scaling in *BSD systems.
3.10.0 - 25-Sep-2017

View File

@ -456,6 +456,7 @@ sub system_cgi {
} elsif(grep {$_ eq $config->{os}} ("FreeBSD", "OpenBSD", "NetBSD")) {
$total_mem = `/sbin/sysctl -n hw.physmem`; # in bytes
chomp($total_mem);
$total_mem = int($total_mem / 1024); # in KB
}
$total_mem_bytes = int($total_mem * 1024); # in bytes
$total_mem = int($total_mem / 1024); # in MB