How to allocate more RAM for Minecraft Servers:
Usually, servers work fine with the stock amount, assuming you don't have too many players.
Usages of more memory:
- More RAM for multiplayer map buffering (less reloading)
- Better working with RAM intensive mods
- More view distance
- Faster first world generation
- Less lag with more players
- Faster map rebuild
What is RAM?
RAM stands for Random Access Memory. It is the memory space that applications use to work in, like the desk space you have in your office cubicle or something. Most laptops have 2-8GB of it, and average gaming rigs have anywhere from 8-24 (on average, anyway. Some can have up to 32 or 64). The amount of RAM an application has determines how fast it can possibly work.
This tutorial requires that you've installed a full Java version, (Java SE) on your system. Else it might not work right. Installing the right Java version (also important: 32/64 bit) often solves many problems.
If you don't have installed Java, get it here!
- Download the server (obviously)
- Create a .txt file. Input
- Rename the extension from .txt to .bat
- Run the .bat, this should activate the server. If running an exe, add gui after .exe in the .bat code. This will launch the Cmd Line application and the server GUI. Both will work the same.
java -Xms#$ -Xmx#$ -jar &"
Key: # = Amount of --> $ = G for gigabyte, M for megabyte, and B for byte; & for EXACT name and file extension of server jar/exe.
If you are on OS X, you can still use .bat, but .sh is native and more compatible.
- The server will not function if the allocated RAM is more than installed.
- It is recommended to use half or less. More than half could result in a slower system.
- ALWAYS WATCH YOUR MEMORY AND CPU USAGE IN TASK MANAGER (if on OS X, use Activity Monitor)
- I've been told that 32-bit Java cannot handle more than 4GB of RAM allocation.
- -Xmx is the maximum of RAM which the server can use.
- -Xms is the allocated RAM at the beginning.
- -Xms must not be greater than -Xmx!
How do I check how much RAM I have installed?
On Windows, search "dxdiag" and use that. On OS X, click on the little apple on the top left and click About... or whatever OS X says these days.