Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

  • Both users have no JAVA* env vars set.
  • The crash does not depend on the current working directory.
  • According to strace, no files in the home directory are opened.

I have no idea what can be the reason. Any help will be appreciated.

share|improve this question
    
You might get better answers at @ AskUbuntu –  Sathya Oct 29 '10 at 16:03
    
Sathya: Thanks! I didn't know about AskUbuntu –  marcin Oct 29 '10 at 17:13
add comment

1 Answer

up vote 1 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.