fix(striker-ui): correct free memory calculation

main
Tsu-ba-me 1 year ago
parent c5c344b978
commit 8eda5b1849
  1. 8
      striker-ui/components/Memory.tsx

@ -35,14 +35,18 @@ const Memory = (): JSX.Element => {
<BodyText text={`Allocated: ${toBinaryByte(nAllocated)}`} />
</Box>
<Box>
<BodyText text={`Free: ${toBinaryByte(nTotal - nAllocated)}`} />
<BodyText
text={`Free: ${toBinaryByte(
nTotal - (nReserved + nAllocated),
)}`}
/>
</Box>
</Box>
<Box display="flex" width="100%">
<Box flexGrow={1}>
<AllocationBar
allocated={Number(
((nAllocated + nReserved) * BigInt(100)) / nTotal,
((nReserved + nAllocated) * BigInt(100)) / nTotal,
)}
/>
</Box>

Loading…
Cancel
Save