Skip to content

Commit

Permalink
feat: reduce memory require
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH committed Oct 13, 2023
1 parent eae7820 commit e4a6a65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions service/rauc.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ func getFreeMemory() (uint64, error) {
if err != nil {
return 0, err
}
// /proc/meminfo中内存的单位是KB,所以需要转换成GB
return mem / 1024 / 1024, nil
// /proc/meminfo中内存的单位是KB,所以需要转换成MB
return mem / 1024, nil
}
}
if scanner.Err() != nil {
Expand All @@ -159,8 +159,8 @@ func getFreeMemory() (uint64, error) {

func CheckMemory() error {
mem, err := getFreeMemory()
if mem < 2 {
return fmt.Errorf("memory is less than 2GB")
if mem < 600 {
return fmt.Errorf("memory is less than 600MB")
}
if err != nil {
return err
Expand Down

0 comments on commit e4a6a65

Please sign in to comment.