Skip to content

Commit

Permalink
ci(gh-actions): fix memory calculation (mb not gb)
Browse files Browse the repository at this point in the history
  • Loading branch information
monyarm committed Jan 22, 2024
1 parent 30def32 commit 74607cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ eval-packages: create-result-dirs
if [ "{{os}}" = "darwin" ]; then
pages="$(vm_stat | grep 'Pages free:' | tr -s ' ' | cut -d ' ' -f 3 | tr -d '.')"
page_size="$(pagesize)"
max_memory_mb="${MAX_MEMORY:-$(echo $((($pages * $page_size) / 1024 / 1024 / 1024))Gi)}"
max_memory_mb="${MAX_MEMORY:-$(echo $((($pages * $page_size) / 1024 / 1024 )))}"
else
free="$(cat /proc/meminfo | grep MemFree | tr -s ' ' | cut -d ' ' -f 2)"
cached="$(cat /proc/meminfo | grep Cached | grep -v SwapCached | tr -s ' ' | cut -d ' ' -f 2)"
buffers="$(cat /proc/meminfo | grep Buffers | tr -s ' ' | cut -d ' ' -f 2)"
shmem="$(cat /proc/meminfo | grep Shmem: | tr -s ' ' | cut -d ' ' -f 2)"

max_memory_mb="${MAX_MEMORY:-$(echo $((($free + $cached + $buffers + $shmem) / 1024 / 1024))Gi)}"
max_memory_mb="${MAX_MEMORY:-$(echo $((($free + $cached + $buffers + $shmem) / 1024 )))}"

fi

Expand Down

0 comments on commit 74607cc

Please sign in to comment.