Update build.py to use less memory.