Skip to content

Commit

Permalink
Merge pull request #2 from devsarfo/main
Browse files Browse the repository at this point in the history
Switch to using MemAvailable For Free Memory and Calculate the Used Memory (Fixed Imports)
  • Loading branch information
saeedvaziry authored Jul 10, 2024
2 parents 2564eb9 + 910ef40 commit 2c671e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/memory/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package memory
import (
"fmt"
"os"
"strconv"
"strings"
)

Expand All @@ -21,6 +22,9 @@ func GetMemoryInfo() MemoryInfo {
return memoryInfo
}

//Declare Variables for Calculation
var totalMem, availableMem int64

// Parse the contents to get total, used, and free memory
lines := strings.Split(string(memInfo), "\n")
for _, line := range lines {
Expand Down

0 comments on commit 2c671e3

Please sign in to comment.