Problem

jdk21

1
2
3
4
5
6
jenkins-01  | [0.004s][warning][os,thread] Failed to start thread "GC Thread#0" - pthread_create failed (EPERM) for attributes: stacksize: 1024k, guardsize: 4k, detached.
jenkins-01  | #
jenkins-01  | # There is insufficient memory for the Java Runtime Environment to continue.
jenkins-01  | # Cannot create worker GC thread. Out of system resources.
jenkins-01  | # An error report file with more information is saved as:
jenkins-01  | # /tmp/hs_err_pid7.log

jdk11

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
jenkins-01  | [0.006s][warning][os,thread] Failed to start thread "GC Thread#0" - pthread_create failed (EPERM) for attributes: stacksize: 1024k, guardsize: 4k, detached.
jenkins-01  | #
jenkins-01  | # There is insufficient memory for the Java Runtime Environment to continue.
jenkins-01  | # Cannot create worker GC thread. Out of system resources.
jenkins-01  | # Can not save log file, dump to screen..
jenkins-01  | #
jenkins-01  | # There is insufficient memory for the Java Runtime Environment to continue.
jenkins-01  | # Cannot create worker GC thread. Out of system resources.
jenkins-01  | # Possible reasons:
jenkins-01  | #   The system is out of physical RAM or swap space
jenkins-01  | #   The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
jenkins-01  | # Possible solutions:
jenkins-01  | #   Reduce memory load on the system
jenkins-01  | #   Increase physical memory or swap space
jenkins-01  | #   Check if swap backing store is full
jenkins-01  | #   Decrease Java heap size (-Xmx/-Xms)
jenkins-01  | #   Decrease number of Java threads
jenkins-01  | #   Decrease Java thread stack sizes (-Xss)
jenkins-01  | #   Set larger code cache with -XX:ReservedCodeCacheSize=
jenkins-01  | #   JVM is running with Unscaled Compressed Oops mode in which the Java heap is
jenkins-01  | #     placed in the first 4GB address space. The Java Heap base address is the
jenkins-01  | #     maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress
jenkins-01  | #     to set the Java Heap base and to place the Java Heap above 4GB virtual address.
jenkins-01  | # This output file may be truncated or incomplete.
jenkins-01  | #
jenkins-01  | #  Out of Memory Error (workerManager.hpp:70), pid=7, tid=7
jenkins-01  | #
jenkins-01  | # JRE version:  (11.0.24+8) (build )
jenkins-01  | # Java VM: OpenJDK 64-Bit Server VM (11.0.24+8, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
jenkins-01  | # Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to //core.7)
jenkins-01  | #

Same Problem

Cause

Latest glibc will attempt to use clone3(). As a result, most newer distro (ubuntu Jammy 22.04, but probably others) will fail unless we allow the syscall (in docker, in systemd…).

Solution

  • Update Docker Engine to >20.10.16 or <20 (suggested)
  • Use other base image (e.g. alpine) instead of Ubuntu LTS 22.04 Jammy
  • Use --security-opt seccomp=unconfined (not suggested)