According to the XWiki docs, 1GB should be sufficient to run XWiki.


For Java 8 (i.e. XWiki >= 8.1). Notice that there's no permgen anymore in Java 8: Small and medium installs: A minimum of 1024MB (-Xmx1024m)

I installed and configured Tomcat according to the documentation.


I have (in conf/tomcat.conf)

JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xmx750m -XX:MaxPermSize=125m -XX:+HeapDumpOnOutOfMemoryError"

And sometimes

JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xmx1024m -XX:MaxPermSize=192m -XX:+HeapDumpOnOutOfMemoryError"

And it is crashing randomly. I cannot even add another user. This is the first part of the dump file hs_err_pid11420.log

# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (mmap) failed to map 105709568 bytes for committing reserved memory.
# Possible reasons:
#   The system is out of physical RAM or swap space
#   The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
#   JVM is running with Unscaled Compressed Oops mode in which the Java heap is
#     placed in the first 4GB address space. The Java Heap base address is the
#     maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress
#     to set the Java Heap base and to place the Java Heap above 4GB virtual address.
# This output file may be truncated or incomplete.
#  Out of Memory Error (os_linux.cpp:2766), pid=11420, tid=0x00007fcd0d720700
# JRE version: OpenJDK Runtime Environment (8.0_212-b04) (build 1.8.0_212-b04)
# Java VM: OpenJDK 64-Bit Server VM (25.212-b04 mixed mode linux-amd64 compressed oops)

I am not using HSQLDB. I am using Postgresql on the same server.

CentOS Linux release 7.6.1810 (Core), XWiki 10.11.8


I fixed it by adding a swapfile.


dd if=/dev/zero of=/swapfile count=125 bs=1MiB # 125 MB
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
sysctl vm.swappiness=10
sysctl vm.vfs_cache_pressure=50

I reduced Tomcat to 750MB (which seems crazy high for an empty wiki).

JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom -Djava.awt.headless=true -Xmx750m -XX:MaxPermSize=125m -XX:+HeapDumpOnOutOfMemoryError"

Now my top shows pretty much nothing free but it doesn't crash.

%Cpu(s):  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  1015008 total,    67244 free,   844308 used,   103456 buff/cache
KiB Swap:   127996 total,        0 free,   127996 used.    18232 avail Mem

13409 tomcat    20   0 3065908 741928   3724 S  0.3 73.1   2:30.68 java

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.