问题
I run a mine craft server on a 32 bit Ubuntu system if I upgrade to64 bit what is the max memory I can give to java? I want it to have about 12 gig of ram but I can't do that on 32bit
回答1:
There is effectively no maximum in the amount of ram a 64-bit system can address. You will be stopped only by your computer's hardware. I don't think java has a max amount of alloted RAM, either, provided you use the right switch in the command.
http://en.wikipedia.org/wiki/64-bit
回答2:
Just to be clear, "hardware" includes paging / swap space, so if you actually require 12GB and only have 8GB of RAM, you'll need to be sure to have 4GB of spare swap space in order for Java to allocate additional memory successfully.
回答3:
From the Java Tuning white paper:
For a 32-bit process model, the maximum virtual address size of the process is typically 4 GB, though some operating systems limit this to 2 GB or 3 GB. The maximum heap size is typically -Xmx3800m (1600m) for 2 GB limits), though the actual limitation is application dependent. For 64-bit process models, the maximum is essentially unlimited.
But truth is, such a huge heap memory usage (12GB) is counterproductive. After running for a long time, the time your application spends doing garbage collection will negate the effect of having so much memory available.
来源:https://stackoverflow.com/questions/10158844/max-memory-you-can-give-to-java