[SPIGOT-6052] Is this a memory leak? Created: 09/Aug/20  Updated: 09/Aug/20  Resolved: 09/Aug/20

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: wysohn Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: 1.16.1, crash

Attachments: Text File crash-2020-08-08_22.44.46-server.txt    
Version: This server is running Paper version git-Paper-133 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)
Plugin: Fast Chunk Pregenerator, Chunky
Guidelines Read: Yes

 Description   

22:44:46 [SEVERE] survival > Encountered an unexpected exception
22:44:46 [INFO] survival > java.lang.OutOfMemoryError: Java heap space
22:44:46 [INFO] survival > at it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.rehash(Long2ObjectOpenHashMap.java:1060) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.insert(Long2ObjectOpenHashMap.java:272) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.put(Long2ObjectOpenHashMap.java:280) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.RegionFileSection.a(RegionFileSection.java:121) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.RegionFileSection.loadInData(RegionFileSection.java:104) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.PlayerChunkMap.lambda$f$33(PlayerChunkMap.java:1133) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.PlayerChunkMap$$Lambda$4270/317833852.apply(Unknown Source) ~[?:?]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.PlayerChunkMap.lambda$null$34(PlayerChunkMap.java:1172) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.PlayerChunkMap$$Lambda$4361/612266480.run(Unknown Source) ~[?:?]
22:44:46 [INFO] survival > at com.destroystokyo.paper.io.chunk.ChunkTaskManager.pollChunkWaitQueue(ChunkTaskManager.java:246) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.ChunkProviderServer$a.executeNext(ChunkProviderServer.java:1044) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.ChunkProviderServer.runTasks(ChunkProviderServer.java:635) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.MinecraftServer.aZ(MinecraftServer.java:1146) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.MinecraftServer.executeNext(MinecraftServer.java:1130) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1091) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:1005) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.1.jar:git-Paper-133]
22:44:46 [INFO] survival > at net.minecraft.server.v1_16_R1.MinecraftServer$$Lambda$2940/959464317.run(Unknown Source) ~[?:?]
22:44:46 [INFO] survival > at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]
22:44:46 [SEVERE] survival > This crash report has been saved to: /media/user/diskServer/bungee/SubServers/Servers/survival/./crash-reports/crash-2020-08-08_22.44.46-server.txt

 

I know you will say that it's just because of not enough memory allocated, but please read before skipping!

So I'm facing this server crash several times, and I find it odd since it always fails at it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap.rehash(Long2ObjectOpenHashMap.java:1060) every single time.

I'm trying to pre-generate the chunks, which will be 20000 radii of blocks, so I tried two different chunk pre-generators available, and they end up encounter the same OutOfMemoryError at the exact same point.

I strongly feel like somewhere in the chunk ticketing system is leaking, yet I can't really pinpoint where could be the problem.

Add to the plugins I used, I also created a Java application for test purposes (https://github.com/wysohn/ChunkPreGenerator/blob/master/src/main/java/Main.java) and it somehow throws the same error. This is using the Spigot instead of Paper, so I don't think using Paper does a lot in this specific case.

All I did was just adding tickets and remove tickets so the chunks can be generated. Well, I ended up giving up on that, yet it's odd since the same thing is happening using the plugins.

I will continue generating the chunks hoping it doesn't crash again, yet let me know if you have any idea.



 Comments   
Comment by wysohn [ 09/Aug/20 ]

Using different GC solved the problem. Sorry!

Generated at Tue Apr 15 09:41:40 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.