0

I have about 4GB of available memory and 1GB of free memory. Can I allocate 5GB to my Minecraft server? I am a noob, just got Ubuntu :D

I have no idea what the difference between free and available memory is.

2
  • 1
    Is the minecraft server running in a VM? if the minecraft server is standalone, it should already be using all the memory... but will only use as much as it needs Dec 8, 2018 at 6:33
  • i don't reallly know-- but on windows 10, i have a .bat file that has this: java -Xmx4G -Xms4G -d64 -jar spigot-1.13.2.jar nogui obviously on ubuntu it has to be a bash file, but i want to know if i can do -xmx5g -xms5g Dec 8, 2018 at 12:45

2 Answers 2

1

Let's see a typical free output:

              total        used        free      shared  buff/cache   available
Mem:       32806952     7552612      780696      949180    24473644    23843300
Swap:       2097148       36864     2060284

Here available is free + part of buff/cache, you could not add them together because free will be counted twice.

Also if you allocate all available memory to your minecraft server, it means your computer will not have any memory left to use disk cache. OS will try to swap something out, and could be incredibly slow.

0

Follow the 'Available' estimate, or your system will start to swap (and slow down). Remember that it's an estimate - it might be high, it might be low.

Let's review the relevant memory definitions: (from https://askubuntu.com/a/859664/19626)

Total = Used + Free

Available: Estimation of how much memory is available for starting new applications, without swapping. Unlike the data provided by the cache or free fields, this field takes into account page cache and also that not all reclaimable memory slabs will be reclaimed due to items being in use.

Note that 'Available' and 'Free' are apples-and-oranges. Do not add them and expect a useful result.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .