libjvm crashes in fork

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux (RHEL)
  • Java
    • OpenJDK

Issue

  • Our JVM crashes at start up sometimes in a fork call from libjvm:
Stack: [0x00007fbfe72eb000,0x00007fbfe73ec000],  sp=0x00007fbfe73ea730,  free space=1021k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x72e7c2]  JVM_handle_linux_signal+0xd332
V  [libjvm.so+0x770303]  JVM_handle_linux_signal+0x4ee73
V  [libjvm.so+0x8300dd]  JVM_handle_linux_signal+0x10ec4d
V  [libjvm.so+0x75013d]  JVM_handle_linux_signal+0x2ecad
V  [libjvm.so+0x49a6b9]  AsyncGetCallTrace+0x3a239
V  [libjvm.so+0x71ec02]  fork1+0x4ff2

Resolution

  • Increase the user's process limit who is launching the JVM. That is typically adjusted in /etc/security/limits.d/90-nproc.conf. If running the process through a service, then consider increasing it in the beginning of the service script:

      ulimit -u ###
    

Root Cause

  • The process limit is too low, resulting in a fork failure when the JVM is initializing and creating required threads.
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.