Skip to content

Instantly share code, notes, and snippets.

@ptnplanet
ptnplanet / memory-config
Last active August 29, 2015 14:11
A bash script recommending a Hadoop memory configuration depending on CPU cores and available physical RAM.
#/bin/bash
phymem=$(free -m|awk '/^Mem:/{print $2}')
echo "Total physical memory on this machine is $phymem MB"
if [ -n "$1" ]
then
phymem=$1
echo "Total physical memory set to $phymem MB"
fi