Update memory allocations

This updates the memory allocations to use metaspace instead of permgen.