JDK-4703298 : LIN64: java process is killed while allocating all memory
  • Type: Bug
  • Component: vm-legacy
  • Sub-Component: jvmdi
  • Affected Version: 1.4.1,1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: linux_redhat_7.2
  • CPU: x86,itanium
  • Submitted: 2002-06-17
  • Updated: 2012-10-01
  • Resolved: 2002-12-02
Related Reports
Duplicate :  
Relates :  
Description
Name: ipR10196			Date: 06/17/2002


--------------------------------------
Test            : Xnsk/jvmdi/Allocate/alloc001
TestBase        : testbase_nsk
VM              : server 64-bit
Mode            : int
Platform        : Itanium
OS              : Redhat Linux 7.2
----------------------------------------

Steps to reproduce 
================
1. cd /net/sqesvr.eng/export/vsn/GammaBase/Bugs/{BugID}
2. sh doit.sh $JAVA_HOME

This testcase passed on Windows-ia64 and failed on Linux-ia64.
This testcase checks JVMDI memory allocation features. On the final
"Out of memory check" it tries to allocate all available memory until 
JVMDI_ERROR_OUT_OF_MEMORY is received. However, on Linux-ia64 java 
process is killed instead:

  >>> Null pointer check ...
  >>> ... done
  >>> Accessibility check ...
  >>> ... done
  >>> Out of memory check ...
  doit.sh: line 115: 20707 Killed $JDK/bin/java$JG $OPT -Xdebug -Xnoagent -Xrun${TEST}:$PAR $TEST
  Exit Code: 137

The following is e-mail message from Bob Vandette about this failure:
--------------------------------------------------------------------
Date: Wed, 12 Jun 2002 12:59:16 -0400
From: Bob Vandette <###@###.###>
To: "Ivan Popov[Contractor]" <###@###.###>
CC: Jim Holmlund <###@###.###>, ###@###.###, 
    ###@###.###, ###@###.###
Subject: Re: testcase for JVMDI memory management

According to Steve Goldman who looked at this, this bug is in the Linux
OS.  If you allocate all the memory in the system, Linux terminates your
application rather than returning an error to the malloc system call.

This does not affect Java applications, only native JNI code that does it's
own memory allocation.

So if you file a bug, we will probably have to keep it open until the next rev
of the OS.

Bob.
--------------------------------------------------------------------

I've also noticed once that the test hanged up in the final loop
of memory eating on 64-bit Solaris-sparcv9 platform, but I cannot 
reproduce this failure anymore.

======================================================================

Name: elR10090			Date: 10/06/2003


The JVMTI variant of the same test also causes the 
same problem with Linux/AMD64:

    Xnsk/jvmti/Allocate/alloc001


======================================================================

Comments
EVALUATION This is the result of a linux bug. It doesn't report an error code when malloc runs out of memory if virt mem usage is set to unlimited. See the Work Around. I'm not sure if we can workaround this bug in JVMDI.
11-06-2004

WORK AROUND Do this in sh: ulimit -v 100000 Steve Goldman discovered this workaround.
11-06-2004