2

I am doing quite expensive for the memory parsing of 50000 HTML pages. While parsing, I am writing them to the database which is defined in my docker-compose.yml file. After 25000 pages are parsed parsing stops and I get such an error:

AsyncExecutor.default-11" java.lang.OutOfMemoryError: Java heap space

How can I change Java heap size in my docker-compose file so all the data could fit into the database?

My docker-compose file looks like this:

version: '2'
services:
  app:
    image: "user/app:latest"
    depends_on:
      - "db"
  api:
    image: "user/=api:latest"
    ports:
      - "7070:7070"
    depends_on:
      - "db"
  db:
    image: postgres
    environment:
      JVM_OPTS: "-Xms8g -Xms8g"
      POSTGRES_DB: postgresdb
      POSTGRES_USER: user
      POSTGRES_PASSWORD: password

I would be grateful for any advice!

Cassie
  • 339
  • 1
  • 3
  • 13
  • 1
    I think you can find the answer here: https://stackoverflow.com/questions/29923531/how-to-set-java-heap-size-xms-xmx-inside-docker-container – Vadym Dudnyk Feb 15 '18 at 10:35

1 Answers1

0

I've faced the same problem, I did limit the service memory usage (ex. I used 800m) by adding the following attribute: "mem_limit: 800m"

BOUZAR
  • 101
  • 1
  • 3