add mem-size-detection.sh to detect memory size