Synchronize access to getMaxSize.