Runtime.getRuntime().maxMemory()
shows which memory ? Is it Survivor , Eden , Old, Permanent ?
According to API, Returns the maximum amount of memory that the Java virtual machine will attempt to use. If there is no inherent limit then the value Long.MAX_VALUE will be returned.