aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions')
-rw-r--r--src/main/java/com/google/devtools/build/lib/actions/LocalHostResourceManagerLinux.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/LocalHostResourceManagerLinux.java b/src/main/java/com/google/devtools/build/lib/actions/LocalHostResourceManagerLinux.java
index 59ab78775a..b889742bf5 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/LocalHostResourceManagerLinux.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/LocalHostResourceManagerLinux.java
@@ -43,7 +43,8 @@ public class LocalHostResourceManagerLinux {
return getPhysicalCpuCountHelper(logicalCpuCount, content);
}
- private static double getMemoryInMb() throws IOException {
+ private static double getMemoryInMb()
+ throws IOException, ProcMeminfoParser.KeywordNotFoundException {
return getMemoryInMbHelper(MEM_INFO_FILE);
}
@@ -60,7 +61,7 @@ public class LocalHostResourceManagerLinux {
logicalCpuCount * (hyperthreading ? EFFECTIVE_CPUS_PER_HYPERTHREADED_CPU : 1.0),
1.0,
Integer.MAX_VALUE);
- } catch (IOException | IllegalArgumentException e) {
+ } catch (IOException | ProcMeminfoParser.KeywordNotFoundException e) {
return null;
}
}
@@ -123,7 +124,8 @@ public class LocalHostResourceManagerLinux {
return cpuCount * coresPerCpu;
}
- public static double getMemoryInMbHelper(String memInfoFileName) throws IOException {
+ public static double getMemoryInMbHelper(String memInfoFileName)
+ throws IOException, ProcMeminfoParser.KeywordNotFoundException {
ProcMeminfoParser memInfo = new ProcMeminfoParser(memInfoFileName);
double ramMb = ProcMeminfoParser.kbToMb(memInfo.getTotalKb());
return ramMb;