Skip to content

Commit

Permalink
Fail on systems with insufficient memory.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Groudas committed Apr 30, 2021
1 parent 588107e commit a7f2c03
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mcrouter/scripts/get_and_build_by_make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ INSTALL_AUX_DIR="${1%/}"/install/aux

[ -n "$TARGET" ] || ( echo "Target missing"; exit 1 )

SYSTEM_MEM="$(free -g | grep "^Mem:" | tr -s '[:blank:]' | cut -d ' ' -f 2)"
if (( ${SYSTEM_MEM:-0} <= 25 )); then
echo "mcrouter needs a lot of memory to compile, and is known to exhaust memory on 16gb systems." >&2
echo "On EC2 consider an instance with 32 GB of memory, like an m6g.2xlarge or m5a.2xlarge" >&2
exit 1
fi

mkdir -p "$PKG_DIR" "$INSTALL_DIR" "$INSTALL_AUX_DIR"
mkdir -p "$INSTALL_DIR/lib"

Expand Down

0 comments on commit a7f2c03

Please sign in to comment.