Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • aports aports
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare
  • Issues 640
    • Issues 640
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 319
    • Merge requests 319
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • alpinealpine
  • aportsaports
  • Issues
  • #13032
Closed
Open
Issue created Sep 23, 2021 by Clive Verghese@cliveverghese

Obtaining Heap Dumps when Java Process pid is 1 fails.

When trying to create a heap dump when the Java Process ID is 1 for OpenJDK8 fails with the following error

1: Unable to get pid of LinuxThreads manager thread

See Related issues

  1. https://github.com/docker-library/openjdk/issues/372
  2. https://github.com/docker-library/openjdk/issues/76

We have a patch that fixes this issue in Corretto-8.

Reproducer

Run

cat <<EOF > Main.java
public class Main {
        public static void main(String[] args) {
                while(true) {
                }
        }
}
EOF

cat <<EOF > Dockerfile
FROM alpine:latest

RUN apk add openjdk8

ADD Main.java ./
RUN /usr/lib/jvm/java-8-openjdk/bin/javac Main.java

ENTRYPOINT java Main
EOF

docker build . -t test-image
docker run test-image

In a separate terminal in run

docker ps # Obtain the container id for the previously executed container
docker exec -it <container_id> /bin/sh

jmap -dump:format=b,file=heap.bin 1
Edited Sep 23, 2021 by Clive Verghese
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking