itzg / docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup
https://docker-minecraft-server.readthedocs.io/
Apache License 2.0
9.55k stars 1.56k forks source link

JVM Memory Error #1745

Closed tommaso-ascani closed 2 years ago

tommaso-ascani commented 2 years ago

Describe the problem

I'm trying to start the server with Curse Forge mod pack, but keep getting this error.

Hope you can help me!

Container definition

version: "3.8"

services:
  mc:
    container_name: minecraft-server
    image: itzg/minecraft-server
    environment:
      EULA: "true"
      DEBUG_MEMORY: "true"
    ports:
      - "25565:25565"
    restart: unless-stopped
    volumes: 
      - ./data:/data
    env_file:
      - .env

---------------------------------------------
# General
TZ=Europe/Rome
TYPE=CURSEFORGE
CF_SERVER_MOD=ATM7-0.4.32-server.zip
OVERRIDE_SERVER_PROPERTIES=false

# Server Configuration
MOTD="All The Mods - Fatturare"
MODE=survival
DIFFICULTY=normal
OPS=
SPAWN_PROTECTION=0
PVP=true
SERVER_NAME=Fatturare
ALLOW_NETHER=true
ANNOUNCE_PLAYER_ACHIEVEMENTS=true
FORCE_GAMEMODE=true
GENERATE_STRUCTURES=true
SPAWN_ANIMALS=true
SPAWN_MONSTERS=true

# Optimization Settings
USE_AIKAR_FLAGS=true
INIT_MEMORY=1G
MAX_MEMORY=4G

# Autopause Settings
ENABLE_AUTOPAUSE=true
MAX_TICK_TIME=-1

Container logs

[init] Running as uid=1000 gid=1000 with /data as 'drwxrwxr-x 3 1000 1000 4096 Sep 22 22:19 /data'
[init] Resolved version given LATEST into 1.19.2 and major version 1.19
[init] Autopause functionality enabled
[init] Resolving type given CURSEFORGE
[init] Looking for Feed-The-Beast / CurseForge server modpack.
[init] detected FTB, changing properties path to /data/FeedTheBeast/server.properties
[init] server.properties already created, skipping
[init] Updating ops
[init] Asca1316 already present in ops.json, skipping
[init] Checking for JSON files.
[init] Using Aikar's flags
[init] Memory usage and availability (in MB)
Linux 2734ec3fc6f8 5.15.61-v8+ #1579 SMP PREEMPT Fri Aug 26 11:16:44 BST 2022 aarch64 aarch64 aarch64 GNU/Linux
              total        used        free      shared  buff/cache   available
Mem:           7862         125        7298           8         437        7620
Swap:             0           0           0
[init] Setting initial memory to 1G and max to 4G
[init] Running FTB /data/FeedTheBeast/run.sh in /data/FeedTheBeast ...
OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000600000000, 8589934592, 0) failed; error='Not enough space' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 8589934592 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /data/FeedTheBeast/hs_err_pid418.log
2022-09-22T23:11:46.183+0200    WARN    mc-server-runner        Minecraft server process failed {"exitCode": 1}
2022-09-22T23:11:46.184+0200    INFO    mc-server-runner        Done
itzg commented 2 years ago

There is insufficient memory for the Java Runtime Environment to continue.

Your docker host needs more memory.

tommaso-ascani commented 2 years ago

The host is a RaspberryPi 4 - 8 GB, the only solution is not hosting the server?

itzg commented 2 years ago

I was thinking you might be using the default 32-bit Raspbian build, but the meminfo seems to clarify it's 64-bit. In that case, it seems like ATM7 start script is not honoring the memory setting since you requested a min of 1 GB and max of 4 GB yet the error talks about 8 GB allocation. There's only 7620 MB available, so 8 GB is too much.

tommaso-ascani commented 2 years ago

So i can try with another modpack or nothing to do?

itzg commented 2 years ago

Another modpack is definitely worth a try. Otherwise, manually editing the modpack's start script in ./data/FeedTheBeast might work.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Please add a comment describing the reason to keep this issue open.