Update from 14.4.1 to 14.5.0 runs OOM on docker startup

For us 14.4.1 was running fine using a docker-compose setup.

Now, when I simply bump the version up to 14.5.0 then I get an out of memory error.

Configuring XWiki...
Setting environment variables
  Deploying XWiki in the 'ROOT' context
Replacing environment variables in files
  Generating authentication validation and encryption keys...
  Setting permanent directory...
  Configure libreoffice...
  Reusing existing config file hibernate.cfg.xml...
  Reusing existing config file xwiki.cfg...
  Reusing existing config file xwiki.properties...
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
[0.004s][warning][os,thread] Failed to start thread - pthread_create failed (EPERM) for attributes: stacksize: 1024k, guardsize: 4k, detached.
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Cannot create worker GC thread. Out of system resources.
# An error report file with more information is saved as:
# /usr/local/tomcat/hs_err_pid1.log

The docker compose file looks like this:

  web:
    image: xwiki:14.5.0-postgres-tomcat # adjust XWIKI_VERSION accordingly
    container_name: "xwiki-web"
    environment:
      - JDK_JAVA_OPTS=-Xmx2048M # increase memory size (default: 1024MB)
      - XWIKI_VERSION=14.5.0 # change this, when the image changes
      - DB_USER=${DB_USER}
      - DB_PASSWORD=${DB_PASSWORD}
      - DB_DATABASE=${DB_DATABASE}
      - DB_HOST=xwiki-postgres-db # This seems to be ignored for jdbc connections
    volumes:
      - /mnt/xwiki:/usr/local/xwiki

Is the new version consuming that much more memory? Might this be related to the automatic database migration ?

Why do you say “that much more”? Is 2048M the minimal value that makes your instance work?

I don’t know of any important memory increase but that can happen and maybe you’re were just below the threshold before?

Re memory requirements, see https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Performances/#HMemory

Thanks

Thanks for the link. It states:

Large installs: 2048MB or beyond (-Xmx2048m)

The installation is actually just a fresh one.

Still maybe the - JDK_JAVA_OPTS=-Xmx2048M option is not applied? Would this be the right way to adjust the memory?

Our glowroot shows just below 750MB for the instance with version 14.4.1

But maybe there is just a problem with our server then.

BTW this doesn’t seem correct. See xwiki-docker/README.md at master · xwiki/xwiki-docker · GitHub

I could finally resolve this.

Weirdly enough, it helped to remove the image and pull it again…

Furthermore, the jdk opts are correctly set with the following (still catalina opt should also be set):

- JDK_JAVA_OPTIONS=-Xmx3g

Note that it’s OPTIONS and not OPTS anymore.

Maybe you were using a non-fixed tag like lts or stable or 14 or… In this case you need to pull the image to get the newer versions. Note: You shouldn’t need to remove the image.

Glad that it works now.