mtoensing / Docker-Minecraft-PaperMC-Server

Starts a Minecraft PaperMC server
https://hub.docker.com/r/marctv/minecraft-papermc-server
MIT License
246 stars 92 forks source link

OutOfMemoryError: Java heap space #89

Closed 3ntropie closed 1 year ago

3ntropie commented 1 year ago

Hello,

I've setup a Raspberry Pi 4 Model B 8GB with the minecraft docker image. When I've run it my guest can play for a while but then the server stops responding. When scrolling through the "latest.log" in "mcserver/logs" I find:

[13:02:46] [Netty Epoll Server IO #2/WARN]: [io.netty.channel.AbstractChannelHandlerContext] An exception 'java.lang.OutOfMemoryError: Java heap space' [enable DEBUG level for full stacktrace] was thrown by a user handler's exceptionCaught() method while handling the following exception: java.lang.OutOfMemoryError: Java heap space [13:02:46] [Netty Epoll Server IO #0/WARN]: [io.netty.util.concurrent.AbstractEventExecutor] A task raised an exception. Task: ScheduledFutureTask@321e6527(uncancellable, task: io.netty.handler.timeout.IdleStateHandler$ReaderIdleTimeoutTask@ee11e1b, deadline: 0, period: 0) java.lang.OutOfMemoryError: Java heap space

just before it becomes unresponsive. Do you have any hints what I can do to solve this issue or how I can investigate further?

mtoensing commented 1 year ago

Please read the readme carefully. =)

3ntropie commented 1 year ago

Expect me to be your most stupid user. I don't event know where to look. :-(

Could you point me to the correct file / paragraph?

3ntropie commented 1 year ago

Just for documentation. To solve this issue I'v created a file named "mcserver.sh" in the folder "/etc/profile.d/" with the following contents: export MEMORYSIZE=6G

I'v choosen 6G since my Raspberry has 8GB Memory and I want some spare memory for the OS and some other service running on it. So far the Minecraft server runs fine.

mtoensing commented 1 year ago

You could have done this with the parameters of the container. No need for hacks