Merge "Return TotalMemory size when ddr size is not present" into udc-dev
This commit is contained in:
@@ -1359,7 +1359,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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user