Skip to content

Commit 2c671e3

Browse files
authored
Merge pull request #2 from devsarfo/main
Switch to using MemAvailable For Free Memory and Calculate the Used Memory (Fixed Imports)
2 parents 2564eb9 + 910ef40 commit 2c671e3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/memory/memory.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package memory
33
import (
44
"fmt"
55
"os"
6+
"strconv"
67
"strings"
78
)
89

@@ -21,6 +22,9 @@ func GetMemoryInfo() MemoryInfo {
2122
return memoryInfo
2223
}
2324

25+
//Declare Variables for Calculation
26+
var totalMem, availableMem int64
27+
2428
// Parse the contents to get total, used, and free memory
2529
lines := strings.Split(string(memInfo), "\n")
2630
for _, line := range lines {

0 commit comments

Comments
 (0)