Dynamic JVM memory scaling