I'm wondering if I was to run minecraft in a 32bit or 64bit ubuntu server; would there be a benefit (speed improvements) or something else, or just the same? Downsides?
-
3I guess I'm one of those people who plays Minecraft using the 32-bit JVM on a 64-bit OS, the performance sucks. The moment I switched over to using the 64-bit JVM, performance improved dramatically. The game became playable again. I don't know why, that's just the way it is. YMMV.– Jeff MercadoAug 16, 2011 at 3:30
-
32 bit has a 4 GB memory limit, this could be relevant for huge worlds (also @Jeff)– ZommuterAug 16, 2011 at 3:54
-
@Tobias: Interestingly, my machine only has 4GB of memory so the memory limit shouldn't have affected me AFAIK yet this still happens.– Jeff MercadoAug 16, 2011 at 4:58
-
@Jeff I had the same experience with the 32 and 64 bit JVM. Not sure why.– FambidaAug 16, 2011 at 6:17
-
1@Arda Xi, Alexy13: WoW64 seems to work like the adapter design pattern. It's not an emulation for the same reason Wine is Not an Emulator. In all these cases, the machine code is directly executed on the CPU; only the APIs for system calls and some libraries that need some "translation". (this is different from Intel Mac OS X running PowerPC applications: that was true (CPU) emulation) — See also en.wikipedia.org/wiki/AMD64#Operating_modes– Denilson Sá MaiaAug 16, 2011 at 21:56
6 Answers
Minecraft is written in Java, so it should "adapt" itself to both 32-bit and 64-bit systems (depending if you have a 32-bit or 64-bit Java runtime).
While Minecraft itself is not optimized for 64-bit, it will take advantage of JVM optimizations for 64-bit processors. Basically, this means more general-purpose registers available (16 in 64-bit against 8 in 32-bit, which means better machine code and less RAM access, improving performance) and larger addressable memory. On the other hand, since now pointers take up twice as much space, there is a little extra overhead for using 64-bit.
But you should also think about the operating system, as it will also take advantage of 64-bit improvements. If you have more than 2GB or 3GB of RAM, your operating system should be 64-bit, else it won't access all RAM (or will have a considerable overhead doing so). And if you have a 64-bit operating system, you should also go with a 64-bit Java Runtime for better performance (as other users already commented).
By the way, in my opinion, you should always go to 64-bit unless you have a very good reason to avoid it, like compatibility reasons (which is not this case).
Related question on StackOverflow: Does Java 64bit perform better than the 32bit version?
Wait a minute! I talked code written in Java, but how about native libraries? Like OpenGL support and OpenAL? They are available on both 32-bit and 64-bit versions, and the correct version will be loaded. And I can confirm that on my Linux 64-bit system, it loads the 64-bit version of those native Java libraries. (as an experiment, I've deleted the 32-bit versions and Minecraft still runs fine)
-
-
2Buy Moar RAM! Honestly though, memory is so cheap these days it isn't worth running less than 4 unless your motherboard can't handle it.– AdanionAug 16, 2011 at 12:48
-
1
-
1@Alexy13 If Amazon servers support 64-bit mode, that's because the underlying hardware is 64-bit. Thus, I still think you should go with 64-bit OS and 64-bit Java. As I said, I see no reason for using 32-bit versions unless you have compatibility problems. Aug 16, 2011 at 16:40
-
Minecraft is not designed as a 64-bit application, and thus, while usable on a 64-bit OS, won't see any sorts of improvements from a technical standpoint.
However, if you also install the 64-bit java runtime environment, you may notice some slight performance optimization, but a 64-bit OS on its own will not have much of an effect.
-
Sorry, but I disagree. As Minecraft is written in Java, any improvements come from Java Virtual Machine, and not from Minecraft itself. Aug 16, 2011 at 16:41
-
1@Denilson - be that as it may, I think a downvote is disingenuous, given that the OP never mentioned JVM at all. Aug 16, 2011 at 17:26
-
1The downvote was because I believe this answer is not technically correct. No Java application is designed as 32-bit or 64-bit, as it is the job of Java Runtime. This is different from a game written in C/C++, that gets compiled to one architecture "and thus, while usable on a 64-bit OS, won't see any sorts of improvements…" If this answer was given to a C/C++ game, that would have been an upvote, but for a Java game, I believe it is incorrect. Aug 16, 2011 at 17:45
-
1@Denilson - Again, the JVM, 64 bit or otherwise, is something independent of the operating system being 64-bit. (Admittedly, the former is impossible without the latter, but there are doubtless people who have 64-bit OSes and are using 32-bit Java.) I have edited my answer to clarify this. Aug 16, 2011 at 17:54
-
While I still believe that a 64-bit OS might still have benefits (because the OS itself will also use 64-bit optimizations), it would be nit-picking and not too relevant. Thanks for the clarification! Aug 16, 2011 at 17:59
I'm running my server on a 64 CentOs server and it doesn't seem to have improved anything. Minecraft only records the movements X,Y,Z of the players with items and block placed in the world. So running it on a 32 or 64 bit OS won't change anything.
For better performance of the game you need lots of RAM and fast HDD maybe a 10k RPM or 15 RPM on the server. That way you ensure faster loading and higher efficiency.
I have 8GB RAM on a Quad core system with 2 HDD 10k RPM, and I haven't noticed any lag with 20+ players online.
CPU-bound Java apps will almost always run slower on 64-bit JVM, and Minecraft is no exception. To quote Oracle,
the benefits of being able to address larger amounts of memory come with a small performance loss in 64-bit VMs versus running the same application on a 32-bit VM. This is due to the fact that every native pointer in the system takes up 8 bytes instead of 4.
The fact that 64-bit JVM features more registers alleviates that performance loss, but does not out-weight it. According to Oracle, Java applications on x86 lose 0 to 15% of their original performance when migrated to 64 bit.
Another point to consider is that 64 bit JVM is more memory-hungry: because of those 64-bit pointers, so you'll have to give it 30% more RAM just to match the storage space you had on 32 bits. Another quote from Oracle FAQ:
We have adjusted the defaults for 64-bit implementations to be 30% larger in order to make up for the increased size of Java objects due to larger native pointers. Remember that Java objects contain class and lock pointers so even if you create Java objects which contain only integers, each object takes up additional memory.
Of course, things turn over when you're giving Minecraft lots of RAM, since it will be able to run GC less frequently and keep more chunks in the memory.
To sum up, upgrading is only worth it when you're planning to give it 4 GB or more.
-
Very interesting! The quote from Oracle goes on to say "The good news is that with AMD64 & EM64T platforms running in 64-bit mode, the Java VM gets some additional registers which it can use to generate more efficient native instruction sequences. These extra registers increase performance to the point where there is often no performance loss at all when comparing 32 to 64-bit execution speed" which is confusing because Oracle says that there is indeed a performance degradation. Do you know if these extra registers mitigate the performance impacts associated with making the registers larger? May 28, 2017 at 15:46
-
@alexy13 Those extra registers are not larger, there's just more of them. And the quote about performance loss seems consistent with 0-15% performance loss range: that 0 corresponds to there is often no performance loss at all, 15% being the worst case. May 29, 2017 at 7:16
Using a 32-bit Java Runtime Environment, you may run into errors giving it 2 GB of memory or more:
"%programfiles(x86)%\Java\jre1.8.0_201\bin\java.exe" -Xms2G -Xmx2G -jar server.jar
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
And for 4 GB and up:
java -d32 -Xms4G -Xmx4G -jar server.jar
Invalid initial heap size: -Xms4G
The specified size exceeds the maximum representable size.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
It works with a 64-bit Java:
%programfiles%\Java\jre1.8.0_201\bin\java.exe -Xms4G -Xmx4G -jar server.jar
[main/INFO]: Loaded 0 recipes
[main/INFO]: Loaded 0 advancements
[Server thread/INFO]: Starting minecraft server version 1.13.2
...
Minecraft also seems to come with its own 64-bit JRE which you may use:
"%programfiles(x86)%\Minecraft\runtime\jre-x64\bin\java.exe" -Xms4G -Xmx4G -jar server.jar
Note that the flags -d32
and -d64
don't let you choose an installed 32- or 64-bit JRE (at least on Windows), but rather define the bitness you require. If java
is a 64-bit Java, then -d32
will make it fail because the 64-bit executable does not support 32-bit.
For me, I have got a weird solutions I have a 64-bit Processor and OS, but the game was unplayable, I then decided to try out the x86 version (32-bit). I know this normally doesn't improve anything, but when I did I have a decent framerate of 60fps WHEN RECORDING! The performance dramatically improved with 32-bit for me. However, if your machine is 64-bit, I would recommend using the 64-bit version first, then use the 32-bit. After that you can decide which to use.
My system info ATI Radeon X1200 Graphics AMD Turion 64X2 Dolby Sound Room Atheros Wireless Windows 7 Professional x64 SP1/Ubuntu 13.10 x64
-
Is it possible that you had 64-bit (x86_64) Java 6 and 32-bit (x86) Java 8 installed? That would explain what you are seeing. Java 8 and newer version have very significant optimizations compared to Java 7 and Java 6. Minecraft would be utterly unplayable on Java 6 and very lagless on Java 8. Alternatively, is it possible that your system's kernel is missing a x86_64 OpenGL driver (I do not know much about Linux kernel driver history)? That too might explain what you are seeing because a graphics card is an absolute necessity for Minecraft and 64-bit Java needs 64-bit drivers.– Jack GDec 18, 2019 at 1:12