This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 203587 - IDE is run with Heap dump on OOME: disabled
Summary: IDE is run with Heap dump on OOME: disabled
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Launchers&CLI (show other bugs)
Version: 7.1
Hardware: PC Linux
: P1 normal (vote)
Assignee: Antonin Nebuzelsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-12 09:57 UTC by Petr Cyhelsky
Modified: 2011-11-24 10:39 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Cyhelsky 2011-10-12 09:57:06 UTC
Product Version: NetBeans IDE Dev (Build 201110100600)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b18
System: Linux version 2.6.38-11-generic running on amd64; UTF-8; en_US (nb)

Heap dump on OOME is disabled with JDK 1.7
It seems to be that the root of the problem is following part of./platform/lib/nbexec  

if "${jdkhome}/bin/java" -XX:+HeapDumpOnOutOfMemoryError > /dev/null 2>&1 ; then
   jargs="$jargs -XX:+HeapDumpOnOutOfMemoryError"
   if echo $jargs | grep -v -- "-XX:HeapDumpPath=" > /dev/null ; then
      jargs="$jargs -XX:HeapDumpPath=\"${userdir}/var/log/heapdump.hprof\""
   fi
fi

on jdk 6 return value of ${jdkhome}/bin/java" -XX:+HeapDumpOnOutOfMemoryError is 0 but on jdk 7 the return value (at least on my box) is 130
Comment 1 Antonin Nebuzelsky 2011-10-14 13:31:52 UTC
Starting with JDK 7 the return value of "java" process indicates error (returns a non-zero value) even if the parameters specified for "java" are correct and only no class is specified for the execution.

> on jdk 6 return value of ${jdkhome}/bin/java" -XX:+HeapDumpOnOutOfMemoryError
> is 0 but on jdk 7 the return value (at least on my box) is 130

Unfortunately on my linux box it is not a quite nice 130, but simply 1 (the same 1 as with specifying an incorrect nonexisting parameter).
Comment 2 Antonin Nebuzelsky 2011-10-20 10:32:15 UTC
http://hg.netbeans.org/core-main/rev/a556dd89997c
Comment 3 Quality Engineering 2011-10-24 14:01:50 UTC
Integrated into 'main-golden', will be available in build *201110240600* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/a556dd89997c
User: Antonin Nebuzelsky <anebuzelsky@netbeans.org>
Log: #203587: IDE is run with Heap dump on OOME disabled (starting java with only a valid XX parameter without specifying a class to run does not return exit code 0 anymore with Java 7)
Comment 4 Petr Cyhelsky 2011-11-24 10:39:26 UTC
verified