OpenJDK java crashes - why?

Asked by Marcin Wojdyr

On Ubuntu Linux 10.10 (and I had the same problem on 10.04) java (from openjdk-6-jre-headless) crashes for unknown reason:

me@ub:~$ java -version
#
# A fatal error has been detected by the Java Runtime Environment:
#
# java.lang.OutOfMemoryError: requested 304 bytes for CHeapObj-new. Out of swap space?
#
# Internal Error (allocation.inline.hpp:39), pid=14459, tid=140557172041488
# Error: CHeapObj-new
#
# JRE version: 6.0_20-b20
# Java VM: OpenJDK 64-Bit Server VM (17.0-b16 mixed mode linux-amd64 )
# Derivative: IcedTea6 1.9.1
# Distribution: Ubuntu 10.10, package 6b20-1.9.1-1ubuntu3
# An error report file with more information is saved as:
# /home/me/hs_err_pid14459.log

There is a lot of free memory, so that's not the cause. If I log in as another user, it works:
guests@ub:~$ java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.1) (6b20-1.9.1-1ubuntu3)
OpenJDK 64-Bit Server VM (build 17.0-b16, mixed mode)

So the crash seems to be caused by some local changes that I made, but I can not find what are these changes.

    * Both users have no JAVA* env vars set.
    * The current working directory seems to not matter.
    * According to strace, no files in the home directory are opened.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu openjdk-6b18 Edit question
Assignee:
No assignee Edit question
Solved by:
Marcin Wojdyr
Solved:
Last query:
Last reply:
Revision history for this message
Marcin Wojdyr (wojdyr) said :
#1

The problem was caused by my settings in /etc/security/limits.conf where I set "address space limit" to 1GB. For some reason java needs more than 1GB of virtual memory to start:

  wojdyr@ub:~$ java -version
  java version "1.6.0_20"
  OpenJDK Runtime Environment (IcedTea6 1.9.1) (6b20-1.9.1-1ubuntu3)
  OpenJDK 64-Bit Server VM (build 17.0-b16, mixed mode)
  wojdyr@ub:~$ ulimit -Sv 1048576
  wojdyr@ub:~$ java -version
  #
  # A fatal error has been detected by the Java Runtime Environment:
  #
  # java.lang.OutOfMemoryError: requested 304 bytes for CHeapObj-new. Out of swap space?
  #
  # Internal Error (allocation.inline.hpp:39), pid=3319, tid=140563844388624
  # Error: CHeapObj-new

I don't understand why so much memory is needed. All other programs I use work fine with 1GB limit. Anyway, the problem is solved.