Merge "Return TotalMemory size when ddr size is not present"

This commit is contained in:
Juan Yescas
2023-05-09 22:16:51 +00:00
committed by Gerrit Code Review
2 changed files with 2 additions and 1 deletions

View File

@@ -1360,7 +1360,7 @@ public class Process {
String formatSize = MemoryProperties.memory_ddr_size().orElse("0KB"); String formatSize = MemoryProperties.memory_ddr_size().orElse("0KB");
long memSize = FileUtils.parseSize(formatSize); long memSize = FileUtils.parseSize(formatSize);
if (memSize == Long.MIN_VALUE) { if (memSize <= 0) {
return FileUtils.roundStorageSize(getTotalMemory()); return FileUtils.roundStorageSize(getTotalMemory());
} }

View File

@@ -73,6 +73,7 @@ public class ProcessTest extends TestCase {
} }
public void testGetAdvertisedMem() { public void testGetAdvertisedMem() {
assertTrue(Process.getAdvertisedMem() > 0);
assertTrue(Process.getTotalMemory() <= Process.getAdvertisedMem()); assertTrue(Process.getTotalMemory() <= Process.getAdvertisedMem());
} }
} }