Permalink
Browse files

Handle multiple privvmpages lines https://sourceforge.net/p/webadmin/…

  • Loading branch information...
1 parent 274b0f5 commit 6ed31c6d1c453d42660182a933b2d3ba7f29eefc @jcameron jcameron committed Aug 19, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 proc/linux-lib.pl
View
@@ -228,7 +228,7 @@ sub get_memory_info
{
local %m;
local $memburst;
-if (open(BEAN, "/proc/user_beancounters")) {
+if (&running_in_openvz() && open(BEAN, "/proc/user_beancounters")) {
# If we are running under Virtuozzo, there may be a limit on memory
# use in force that is less than the real system's memory. Or it may be
# a higher 'burstable' limit. Use this, unless it is unreasonably
@@ -242,6 +242,7 @@ sub get_memory_info
if (/privvmpages\s+(\d+)\s+(\d+)\s+(\d+)/ &&
$3 < 1024*1024*1024*1024) {
$memburst = $3 * $pagesize / 1024;
+ last;
}
}
close(BEAN);

0 comments on commit 6ed31c6

Please sign in to comment.