-
-
Notifications
You must be signed in to change notification settings - Fork 3
I'm getting an OOM using this software. What's going on? #183
Comments
I am getting this as well, adjusted server to have 20GB of memory and was running fine then would suddenly spike and use all 20GB after about 5-7 minutes. Have attached heap dump from when server started and just before server crashed. |
No, there is no memory leak. Yes, Pl3xMap uses as much ram as it can. That's by design. What you both are seeing is the server using more ram than the server has to give it. This is due to misconfigurations of the heap allocations on your part. Let's take Temmy's example since it's got actual numbers I can point at. He has a server with 20GB of physical ram. He's telling the MC server it can use 18GB of that by setting 18432MB as his Xmx parameter in the startup script. This leaves little to no room for the OS to operate on or the JVM to breathe (the JVM comes with overhead). Ok, so this is all fine and dandy, because he also told the JVM to start up with only 256MB of heap. this is will below the max limit, so it starts up and is fine. Until something starts needing more heap, then the JVM will grow that 256MB until it reaches the Xmx cap you set at 18GB. Except, the JVM's been crunching heavily on some numbers (in this case, Pl3xMap), so the JVM overhead is rather high. Very probably more than 2GB of overhead. And we still havent thought about the OS, or other programs running on the machine, etc etc. All of a sudden the server has run out of ram before it can even allocate all the heap space you told it it could have. Boom. OOM. See, look for yourself. The physical ram has run out, and the JVM has only allocated 16GB out of the 18GB it was allowed to grab. You'll see the same OOM almost instantly if you were to follow Aikar's advice on his blog post about JVM flags where he states to make sure Xms is the same value as Xmx. This is important, not only for his flags to operate properly, but to ensure the heap can and does get everything you tell it it can get. Another thing you can do is lessen the burden on the JVM/heap by lowering the amount of threads Pl3xMap can use (its in the config.yml file). This will result in Pl3xMap needing less ram at one time to do what it needs to do. Since ya'll look to have only 4 cores, I recommend lowering the thread count to 1 for Pl3xMap. And yet another thing you could do to lessen the burden on your heap is to turn on both GC options in Pl3xMap's config file. This will make the GC run way more aggressively, cleaning out old, dead objects much faster that letting the JVM do it on it's own. So yeah. TLDR; There's no memory leak. Do the 3 things I suggest and you should be fine. |
My server hosts only this single MC server for which I have 5GB (out of total 8GB, with 300MB used by linux) assigned according to Aikar flags (Xmx == Xms). I've already been using both GC flags, and yesterday switched to 1 rendering thread (from -1). The exact same thing happened. In the past I've also experimented with 4GB assigned to the mc server but this didn't solve the issue. To be perfectly clear, my server always takes up a constant amount of RAM unless I switch the Pl3xMap on, at that point, the RAM slowly crawls up and eventually causes server termination. To me this is a clear memory leak. Edit: No players have been playing on the server during that test. |
I have a server that has 32GB of memory and basically only has the server running, this was running fine with an older version of the plugin then when I updated to 1.20 and the latest version it started getting out-of-memory errors and as @MuniuDev mentioned the server would idle at roughly 7GB then would slowly climb until it ran out of memory and would cause it to terminate due to the JVM running out of memory. |
Hi, I had this same issue, I'm running my server under a pterodactyl docker. The problem is that with pl3xmap the server starts increasing the overhead way higher than the xmx. 2 GB should be enough to cover overhead needs, but with plexmap my server was consuming an unreal amount of ram when my XMX was 11 GB. Here's an example: The flags that I was using (I'm on a dedicated server with 32 gb of ram): java -Xms11264M -Xmx11264M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs/ -Daikars.new.flags=true -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -jar server.jar --nogui Server heap usage: The point is that it doesn't matter how much ram you set to XMS and XMX, pl3xmap will start eating ram outside of those values, and if the container doesn't have a ram limit it will ending up eating the whole dedicated server ram. In the case the container have a limit your server will constantly crash due to OOM. I removed pl3xmap and the issue was gone, with the same flags that I put there now my server consumes a max of 13gb. |
Hi,
I've been running Pl3xMap for a few years on my server and I really enjoy it!
Unfortunately, since 1.20.1 update I've been experiencing a constant memory leak that results in OoM termination of the server runtime. I've verified that removing Pl3xMap fixes the issue. I've also tested that using an external webserver (nginx) does not fix the issue.
Few parameters of my server:
I'm using Multiverse to hold a total of 5 dimensions (overworld, nether, end, overworld2, and creative realm (hidden from map))
Screenshot of memory usage at the server start:
![Screenshot_73](https://private-user-images.githubusercontent.com/8275106/252413204-51683633-22b8-4ed4-85ac-fe7d2c34dbc0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxNjgzNDUsIm5iZiI6MTcyNDE2ODA0NSwicGF0aCI6Ii84Mjc1MTA2LzI1MjQxMzIwNC01MTY4MzYzMy0yMmI4LTRlZDQtODVhYy1mZTdkMmMzNGRiYzAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjBUMTUzNDA1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDg5NWM5ZGU4NjQ2N2QwZTI2ZjkzNWZhMWQwMzhiZDhmZTE3NTBmOGYyNTlhMzZmNTBjMTMzNjA1OTY5ZTk1NyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.ULuWqUowbJg7RJLTaz9rV6ZZByX_LHzwcfpshqUbFIA)
And then after 4h:
![Screenshot_74](https://private-user-images.githubusercontent.com/8275106/252413282-b3080a6e-d6ee-424b-9195-a774c990820e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxNjgzNDUsIm5iZiI6MTcyNDE2ODA0NSwicGF0aCI6Ii84Mjc1MTA2LzI1MjQxMzI4Mi1iMzA4MGE2ZS1kNmVlLTQyNGItOTE5NS1hNzc0Yzk5MDgyMGUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjBUMTUzNDA1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDRiMmQ4OGYyYWFmYWM0MmM0YzdlZjAyMjFlOTI1ZmVkMDJlMmIxY2E2MDYwZWE0ZjM3Yjg5NzlmMTc3YWFmMSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Pdc2nTUEwLV52Medu59HN2Q33cOK6ugaxANlczQYXBA)
And finally after about 7h:
![Screenshot_75](https://private-user-images.githubusercontent.com/8275106/252413359-ff437c93-7eba-4ea7-9575-d2b3ed537dd8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQxNjgzNDUsIm5iZiI6MTcyNDE2ODA0NSwicGF0aCI6Ii84Mjc1MTA2LzI1MjQxMzM1OS1mZjQzN2M5My03ZWJhLTRlYTctOTU3NS1kMmIzZWQ1MzdkZDgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjBUMTUzNDA1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDg5Y2FjN2ZkYWE4MTcwOTFjOGM1ZjUzNmMzOTU0NDAzZTM5NzhmYzU3YzI1NmQ5MjA0YTY1ZGVlMDMyYTczZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.4dcoUZNzZ_w9s6oDZ7jmBvf5tGrxqdIvJXsXJRRmC3o)
I'm attaching my config:
config.zip
Thank you for the work and the support with this issue.
The text was updated successfully, but these errors were encountered: