[systeminfo] Fix heap graph too high on axis. (#11351)
Was calculating the “used heap” based on max heap size and not on the currently allocated size. Signed-off-by: Matthew Skinner <matt@pcmus.com>
This commit is contained in:
parent
61324f8b96
commit
f3fbcb622f
|
@ -294,8 +294,8 @@ public class SysteminfoHandler extends BaseThingHandler {
|
|||
state = new QuantityType<>(Runtime.getRuntime().freeMemory(), Units.BYTE);
|
||||
break;
|
||||
case CHANNEL_MEMORY_USED_HEAP_PERCENT:
|
||||
state = new DecimalType((Runtime.getRuntime().maxMemory() - Runtime.getRuntime().freeMemory()) * 100
|
||||
/ Runtime.getRuntime().maxMemory());
|
||||
state = new DecimalType((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())
|
||||
* 100 / Runtime.getRuntime().maxMemory());
|
||||
break;
|
||||
case CHANNEL_DISPLAY_INFORMATION:
|
||||
state = systeminfo.getDisplayInformation(deviceIndex);
|
||||
|
|
Loading…
Reference in New Issue