Windows minecraft server memory

Minecraft Forums

This thread was marked as Locked by webrosc .

[Tutorial] Allocating More RAM to Minecraft Servers


Poll: Was this helpful?

Was this helpful? — Multiple Choice

  • Yes 48.4% of Users — 46 votes
  • Kind of 24.2% of Users — 23 votes
  • No 33.7% of Users — 32 votes
    li» data-page-inline=»False» data-scroll-inline=»False»>

  • Out of the Water
  • Location: San Jose
  • Join Date: 6/2/2011
  • Posts: 4
  • Location: Negative-mass crystal
  • Minecraft: boom1183
  • Member Details

al·lo·cate
ˈaləˌkāt/

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.

Notice:

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.

Instructions:

If you are on OS X, you can still use .bat, but .sh is native and more compatible.

Warning:

— 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.

Syntax:

  • -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.

Minecraft Forums

This thread was automatically marked as Locked.

Adding More RAM to Server??

    li» data-page-inline=»False» data-scroll-inline=»False»>

  • Iron Miner
  • Join Date: 12/16/2010
  • Posts: 288
  • Member Details

  • Diamond Miner
  • Join Date: 9/9/2010
  • Posts: 842
  • Member Details

  • Iron Miner
  • Join Date: 12/16/2010
  • Posts: 288
  • Member Details

  • Zombie Killer
  • Join Date: 12/31/2009
  • Posts: 200
  • Minecraft: seriosbrad
  • Member Details

I posted this in another thread

Try running the server using a .bat file and allocating more RAM to the Minecraft server.

— Create a .txt file, name it anything you want

— Put this inside of your new txt file it will allocated 2GB RAM to the server which should be more than enough.

— Rename yourfile.txt to yourfile.bat

If it’s still laggy, go to speedtest.net and run the test while you are experiencing lag, and then post the result image here.

This same information is available basically everywhere :tongue.gif:

  • Iron Miner
  • Join Date: 12/16/2010
  • Posts: 288
  • Member Details

I posted this in another thread

Try running the server using a .bat file and allocating more RAM to the Minecraft server.

— Create a .txt file, name it anything you want

— Put this inside of your new txt file it will allocated 2GB RAM to the server which should be more than enough.

— Rename yourfile.txt to yourfile.bat

this is what i was looking for. however, no one seems to have made it concise like you have.

If it’s still laggy, go to speedtest.net and run the test while you are experiencing lag, and then post the result image here.

This same information is available basically everywhere :tongue.gif:

  • Iron Miner
  • Join Date: 12/16/2010
  • Posts: 288
  • Member Details
Читайте также:  Apple beta mac os

  • Tree Puncher
  • Join Date: 12/24/2010
  • Posts: 37
  • Member Details

Put this in the directory of your server.

  • Out of the Water
  • Location: Florida
  • Join Date: 1/17/2011
  • Posts: 7
  • Member Details

  • Out of the Water
  • Location: Florida
  • Join Date: 1/17/2011
  • Posts: 7
  • Member Details

  • Tree Puncher
  • Join Date: 12/17/2010
  • Posts: 23
  • Member Details

  • Out of the Water
  • Location: Florida
  • Join Date: 1/17/2011
  • Posts: 7
  • Member Details

  • Iron Miner
  • Join Date: 12/16/2010
  • Posts: 288
  • Member Details

Okay. One last problem. I got the minecraft.jar for the server, but when I use the .bat file, it comes up with this:

I changed the amount in the code to @echo off
java -Xms1048M -Xmx1048M -jar minecraft_server.jar nogui
pause

and it works. but I have at least 3GB of RAM for my computer. How come it can’t allocate at least 2GB for Minecraft Server when it runs? It won’t let me go above 1500M or something around there. I should be able to allocate more RAM, am I correct?

Tutorials/Ramdisk enabled server

This tutorial is intended to give you a basic understanding of what a ramdisk is, what use it is for Minecraft and how to make a Minecraft server use a ramdisk.

Contents

Ramdisk Introduction [ edit ]

Conventionally, files and directories are stored on hard disk drives which, by today’s standards, offer a lot of space at mediocre data transfer rates (between 80MB/s and 200MB/s). Ramdisks are virtual file systems (unlike HDDs which are hardware) that live completely inside the computer’s RAM. They offer significantly higher data transfer rates (between 3,000MB/s and 15,000MB/s) at the cost of volatility (data will be lost after restarting the computer) and space (limited by the amount of RAM installed on the system, including swap space). Many utilities however make it possible to backup Ramdisk data at set intervals, and before the system is shut down, then load the last data when the system starts up.

Advantages and Disadvantages [ edit ]

Advantages [ edit ]

  • Very high transfer speed (data to application)
  • Very low seek time (searching between and in files)

Disadvantages [ edit ]

  • Ramdisks will be cleared when a system restarts (Not true for Dataram RAMDisk)
  • Unfeasible if the world size exceeds the available RAM

Why it makes sense for Minecraft servers [ edit ]

In a Minecraft server, one of the strongest bottlenecks are disk I/O related operations (e.g. chunk management). By moving the data into the RAM, access times will be near instant and data transfer rates will be significantly faster, making chunk loading and saving much faster operations. Since a Minecraft world currently consists of very many chunk files, seek time is equally, if not more, important for overall speed.

Basic Minecraft and ramdisk setup [ edit ]

Make sure to back up your files before starting!

GNU/Linux (Easy Way) [ edit ]

A simple way to load a minecraft server into a ramdisk was posted on the Aimless Bits blog [1] on March 12, 2011. It involves modifying the server startup script available on the wiki and making some minor changes to fstab. This guide fleshes out the process and makes some minor changes to Aimless Bits’ script.

This quick guide assumes you have a user for loading minecraft, a minecraft directory and a server running. It also helps to be familiar with the /etc/init.d/minecraft startup script.

  • Firstly, start by creating a directory for the ramdisk in your home directory, i.e. «/home/username/minecraft_ramdisk».
  • To mount it as a ramdisk, simply edit your /etc/fstab/ file:

Then add this line, making sure that the path is correct (username, dir name etc.)

The size of the ramdisk MUST be larger than the minecraft directory world. Make sure that you give yourself some overhead.

  • Restart your computer. The ramdisk will now be loaded every time you restart. If you wish to load immediately, type

It’s now a matter of simply running a modified script that loads the files on the drive onto the server, copies them back on a timely basis to prevent data loss, and does backups. Again, this is a modified version of the script found at Aimless Bits.

If you have /etc/init.d/minecraft, delete it or overwrite it with this script. If you don’t, make a new text file, call it minecraft, and copy this script into it.

  • Move this script into your /etc/init.d/ directory, and make it executable:

Note: This script misses the command option that the other minecraft init script has on this website, http://www.minecraftwiki.net/wiki/Server_startup_script. Therefore, the script is rewritten with the command code in it, so ramdisk servers can also use the command thing to sync things without having to get another plugin to schedule things: http://pastebin.com/4ynwL2js

You’re almost done! This script behaves exactly like the standard startup script, only that it takes care of loading and maintaining the ramdisk. You can also modify the script to use rsync instead of cp

Читайте также:  Восстановление запуска windows что это

In case you want to do other things, such as remote copying, but performance differences are probably negligible unless you have very big worlds.

  • DO NOT SKIP THIS STEP. You need to add a crontab entry to save your world. See below for specific reasons, but you run the risk of losing data if you don’t do this. This script has two disk save functions, disksavehalt and disksaverun. Disksavehalt assumes the screen session is closing or backing up, and thus does not disable level saving. Do NOT call this function in crontab. Use disksave run instead. To do this

Then add the line:

The number represents how often in minutes should you save the world. If you feel like you have a robust setup, power supply backups and the whole shebang, run this less frequently. Otherwise, stick to 5 minutes at the least!

The other line runs minecraft backup every 6 hours, at :20. Don’t skimp on backups! You’ve been warned!

Hope this helps all those would be admins out there. Good luck!

GNU/Linux (alternative) [ edit ]

On most GNU/Linux distributions there is already a ramdisk set up (usually mounted to /dev/shm (shared memory)) which defaults to using at most half of your total installed RAM. If there is not one already set up, resources on how to do it are widely available on the Internet.

It is possible to move anything into the ramdisk, but there will be a focus on just moving the map into it and leaving the server files on the conventional drive.

Given the following basic server directory «minecraft_server/», inside a user’s home directory, containing the world «world» and all other required files

/minecraft_server/ world/ minecraft_server.jar server.log server.properties .

We will want to move «world/» into the shared memory. Because of the volatility of ramdisks, we will also want to create a new folder into which an automated script will periodically save the current snapshot of the world, called (for example) «world_storage» by copying the current world to a new name

Now with the old world in a safe location, we can go ahead and move the world into the ram-disk

By now, the world is loaded into the RAM, but the Minecraft server doesn’t see it in its directory anymore, causing it to recreate it when started. To stop it from doing that, we have to create a symbolic link to the world in the ramdisk by running

This will create a link to «/dev/shm/minecraft/world/» called «world/» in the server’s directory, which the server will use like the actual world folder, but now inside the RAM.

Now we need to take care of the volatility of the ramdisk, by periodically saving the world from the RAM into «world_storage/». I’m going to use cron for scheduling and rsync for synching here.

First, we need a script that can be called by cron (it doesn’t have to be a script, you could call rsync directly from the cron command line, but this allows for easy customizing later on)

And then we need to make this script execute every few minutes (I’ll use 5 minutes here, you can test out what works best for you)

You will be put into an editor (more precisely: the editor in your «EDITOR» environment variable) for editing your user cron table. Add the following line:

Now if your server restarts you will need to recreate the world folder (/dev/shm/minecraft) then (/dev/shm/minecraft/world) in the shared memory because the /dev/shm/ empties after restart,. You can do this by making another similar shell script.

So make a shell script file like before:

Every time you restart you need to run this script to remount the Ramdisk. Do not add this to the crontab. You can add this to the start up if you figure it out.

GNU/Linux (quick & dirty) [ edit ]

This is a quick and dirty (but functionally identical) version of the GNU/Linux alternative listed above. Here, this technique is used with a Fedora-based server and it works great.

Start from your working server directory and copy the existing world to a backup location:

  • You might want to keep an additional backup copy of the world as well, in case something goes wrong.

We need the directory name «world» to make this work, so remove world/ from the working directory:

Now, we want to redirect the server to a world directory that will be held in shared memory. Do this by creating a soft link from shared memory to your working directory:

Читайте также:  Кодировка символов для windows 1251

Shared memory is volatile, so we need something to back up the world directory to disk periodically. A single line in crontab does the trick:

Now we need a way to «mount» the world in shared memory. Create a start.sh file and include the following 2 lines:

You can use the start.sh script to mount your world in shared memory each time you reboot your server. Then you can start the Minecraft server as normal (or add a 3rd line to start.sh for convenience). If you choose to start the server with start.sh and use the screen command, be sure to start the start.sh script with screen. Do not use screen inside the script or the server will run in the background and you’ll be unable to run console commands.

Windows [ edit ]

Use a Ramdisk utility like Dataram RAMDisk (freeware version available) to create a RAM disk and place the server files on it. Dataram RAMDisk has the option to automatically save an image every time it shuts down and also every few minutes. The free version restricts its maximum disk space to 1G. If larger Ramdisks are required, the Winramtech and the Softperfect Ramdisks seem to offer the best performance with similar features as Dataram RAMDisk.

Before you begin:

  • At least 4G of RAM on your machine is ideal
  • Enabling «Save Disk Image on Shutdown» will impact your Windows shutdown times where you leave RAMDisk running on shutdown, and similarly startup times for «Load Disk Image on Startup». This is not a problem if you manually start and stop the server only when needed.
  • Search the Internet for some ways to save your RAMDisk in case it does not work.
  • FAT16 is generally faster than FAT32 on RAM disks, however FAT16 formatting is not available for partitions over 2048MB
  • REMEMBER: Always have a backup! If your computer crashes, any data on the RAM disk that has not been backed-up/copied to your hard drive will be lost!
  • Make sure that you allocate more than enough memory for the RAM disk than that of the size of your ‘Minecraft Server’ folder — remember that the Minecraft world data can increase by a lot!
  • . and on the other hand, don’t leave too little RAM remaining for the running of Windows and the server itself.

Setting up your RAM disk (Simple usage)

  1. Download and install Dataram RAMDisk
  2. Set your disk size (Setting the maximum is not recommended)
  3. If the disk size you set was 2048MB or less, choose ‘FAT16 Partition’, otherwise choose ‘FAT32 Partition’ (Advanced users may wish to select ‘unformatted’ and format the disk themselves)
  4. Go under the Load/Save tab and select all three RAMDisk saving methods («AutoSave», «Save Disk Image on Shutdown» and «Load Disk Image on Startup»)
  5. Start your RAMDisk — Click ‘Start RAMDisk’
  6. Now go to ‘My Computer’ and you should see a new disk
  7. Open it and copy all your Minecraft Server files in it.
  8. Start your server per usual, now from the RAM disk you have just created — you are now up and running!

Your RAM disk will now automatically save upon shutdown, and will be restored (with data intact) on startup. Depending on the size you set, you will notice longer boot/shutdown times. Also, you may wish to adjust the AutoSave interval.

If you did not select «Save Disk Image on Shutdown», make sure continue reading especially!!

You need to follow these procedures every time you shutdown the computer to avoid data loss!

Stopping the RAM disk manually (Before shutting down computer)

  1. Stop your Minecraft server if it is running
  2. Open the Dataram RAMDisk configuration Utility (again)
  3. Please enable «Load Disk Image on Startup» if not already under the Load/save tab
  4. Click ‘Save disk image now’
  5. Click ‘Stop RAMDisk’

(When you wish to start the server next time, just start it like you did the first time. Only do this IF you ticked ‘Load Disk Image at Startup’) Alternative:

  1. Stop your server
  2. Copy all the files in the RAMDisk to a backup folder in a hard disk
  3. Click ‘Stop RAMDisk’ on the Dataram RAMDisk configuration Utility

(To start it again, start your RAMDisk like you did the first time and copy all the server files into the RAMDisk, then start your server)

macOS [ edit ]

Type this to create your RAM disk on macOS:

It’s only one command line to write, quite fast and efficient.

If you’ve followed these instructions, your Ramdisk will be available in /Volumes/ramdisk. After that, proceed as if you were on Linux, using Terminal and your favorite text editor.

Оцените статью