detects that it can use it and then it sets the max size of the object heap while building. Having the max size set works out better because it allocates it all at once and limits the jdk from growing it a piece at a time randomly into limited VM space.