Docker Java 8 Container with Heavy CPU Usage

We are currently dockerize a Java 8 Application and we have a really strange behaviour. Outside of docker, the application use less than 10% of cpu but when we run the application into a container we have 100% of CPU usage for the container.

Inside of the container (with docker exec -it [container-id] top), the jar only use 10% of cpu.

  • Why log settings don't work without setting --log-driver option while service creation?
  • not able to access angular2 app from docker container
  • laravel queue service in docker container
  • Connecting to a remote docker machine using publickey authentication from Windows
  • Trouble communicating between docker containers
  • Vagrant ssh to Docker container
  • We attempt to use other base docker image like openjdk but it change nothing.

    Docker File:

    FROM anapsix/alpine-java:8
    ADD . /producer
    WORKDIR /producer
    COPY ikb-1.0-SNAPSHOT-producer.jar ikb-1.0-SNAPSHOT-producer.jar
    COPY resources/ /resources/
    CMD ["java", "-jar", "ikb-1.0-SNAPSHOT-producer.jar"]

    We use:

    • Docker version: 1.13.1, build 092cba3
    • Docker-compose version: 1.11.2, build dfed245
    • Server OS: CentOS

  • docker-compose scale service with independent volumes
  • Golang: go build failing when called as part of makefile
  • Is it possible to use docker with jrebel or dcevm
  • How to create docker image with .net core that reference to .net 4.6 class library
  • Editing static resources in Docker with Spring Boot application
  • Docker - How to refer to a label that as a full stop ( . ) in it?
  • One Solution collect form web for “Docker Java 8 Container with Heavy CPU Usage”

    As discussed in our chat, there was a thread in the Java application that was spinning in a tight loop because there was no user input. Stopping that thread caused the CPU to go back to where it belonged.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.