Java Memory error when exporting a project using docker

108 views
Skip to first unread message

Florian Ludwig

unread,
Aug 30, 2021, 9:01:59 PM8/30/21
to inception-users
Hi all,

unfortunately I get the following error message when trying to export an annotation project:

"unexpected error during project export app_1 | java.lang.outofmemoryerror: java heap space."

The export process starts normaly, but slows down and after a while, the error message pops up. I'm running Inception using docker-compose, as sugggested in the admin guide. My docker compose file looks like follows:


##
# docker-compose up [-d]
# docker-compose down
##
version: '2.2'

networks:
  inception-net:

services:
  db:
    image: "mariadb:10.5"
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=yes
      - MYSQL_DATABASE=inception
      - MYSQL_USER=${DBUSER:-inception}
      - MYSQL_PORT=3306
      - MYSQL_PASSWORD=${DBPASSWORD:-inception}
    volumes:
      - ${INCEPTION_DB_HOME:-db-data}:/var/lib/mysql
    command: ["--character-set-server=utf8mb4", "--collation-server=utf8mb4_bin"]
    healthcheck:
      test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-p${DBPASSWORD:-inception}", "-u${DBUSER:-inception}"]
      interval: 20s
      timeout: 10s
      retries: 10
    networks:
      inception-net:

  app:
    image: "${INCEPTION_IMAGE:-inceptionproject/inception}:${INCEPTION_VERSION:-0.19.3}"
    ports:
      - "${INCEPTION_PORT:-8080}:8080"
    environment:
      - INCEPTION_DB_DIALECT=org.hibernate.dialect.MariaDB103Dialect
      - INCEPTION_DB_DRIVER=org.mariadb.jdbc.Driver
      - INCEPTION_DB_URL=jdbc:mariadb://db:3306/inception?useSSL=false&useUnicode=true&characterEncoding=UTF-8
      - INCEPTION_DB_USERNAME=${DBUSER:-inception}
      - INCEPTION_DB_PASSWORD=${DBPASSWORD:-inception}
      - JAVA_OPTS=-Dspring.jpa.properties.hibernate.dialect.storage_engine=innodb
    volumes:
      - ${INCEPTION_HOME:-/srv/inception/app-data}:/export
    depends_on:
      db:
        condition: service_healthy
    mem_limit: 1g
    memswap_limit: 1g
    restart: unless-stopped
    networks:
      inception-net:

volumes:
  app-data:
  db-data:



Do you have any hints, what I can do in order to export the project?

Thank you very much for your help and best regards.
Florian

Richard Eckart de Castilho

unread,
Aug 31, 2021, 1:59:23 AM8/31/21
to inception-users
Hi,

> On 31. Aug 2021, at 03:01, Florian Ludwig <ludwigf...@gmail.com> wrote:
>
> Do you have any hints, what I can do in order to export the project?

During startup, INCEpTION writes to the console log how much memory it
has available.

----
2021-08-31 07:57:44 [main] INFO [SYSTEM] InceptionApplicationContextInitializer - Max. application memory: 4096MB
----

If that memory is not enough, you should be able to increase it by editing your
docker compose file and adding the memory sizes to the JAVA_OPTS variable. E.g.
for 4 GB of memory, you would add "-Xmx4g".

> - JAVA_OPTS=-Dspring.jpa.properties.hibernate.dialect.storage_engine=innodb

Mind that your host system or the VM in which you run docker (e.g. the docker
built-in VM on OS X) has enough memory allocated to itself. Mind that Java and
MySQL will use more than the 4 GB you specific in the JAVA_OPTS. Even Java alone
will use more memory than the 4 GB. As a rough guideline, if you have 8 GB memory
installed in your system, it may get tight if you set the -Xmx parameter higher than
4 GB. If you have 16 GB installed, you should be able to go as high as 12 GB here.

Cheers,

-- Richard
Reply all
Reply to author
Forward
0 new messages