My process uses more memory when executed on Ubuntu 22.04 than when executed on Oracle Linux 8. Is it something to do with the operating system or with the compiled program?
Details:
The process I am running is the one you get when you download Minecraft (Bedrock Edition) from the Minecraft website. In the file downloaded, it's called bedrock_server
, and you're instructed to run it with the command LD_LIBRARY_PATH=. ./bedrock_server
, so my understanding is that there is at least one dynamically linked file that is loaded from that directory too.
# file bedrock_server
bedrock_server: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[xxHash]=51ffa5a7d5d4a199, stripped
I was originally using a 1 GB VPS running Oracle Linux 8 to run it. While it's running, ps
shows the following output:
$ ps aux | head -1; ps aux | sort -rnk 4 | head -1
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 650031 10.9 31.0 2585888 297956 ? Ssl 03:57 82:47 ./bedrock_server
I wanted to try another VPS provider because I was experiencing too much CPU steal with this one, and I chose a 1 GB VPS on that provider too. I chose Ubuntu 22.04 for its OS. But this time, Minecraft stopped working after a few minutes when memory ran out. And I noticed when investigating that it appears to use more memory on this VPS:
# ps aux | head -1; ps aux | sort -rnk 4 | head -1
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 13620 11.0 60.1 1238576 535844 ? Rl 15:53 4:39 ./bedrock_server
According to "RSS", it appears to be using about 250 MB more memory.
I've tried to leave everything the same for this comparison. The files for Minecraft that are being executed and used as data for the world, server settings, etc were copied over from the first VPS to the second.
So as far as I can see, the only difference between these VPSs are the OS used. One is Oracle Linux 8 and one is Ubuntu 22.04. I'd like to understand why this is causing the difference in memory used. Or, if it's not what's causing it, what is.
If this question is too open ended to be answered the way I've phrased it, I think an alternative question phrasing could be "How can I investigate why memory usage is higher in one OS than in another?" etc.