RFR: 8036699: Add trace event when a metaspace allocation fails

Lindenmaier, Goetz goetz.lindenmaier at sap.com
Thu Mar 20 09:22:20 UTC 2014


Hi Erik, 

did you already notice that your change breaks the build without precompiled headers?
This helps:

iff -r 8dc8455614fc src/share/vm/memory/metaspaceTracer.cpp
--- a/src/share/vm/memory/metaspaceTracer.cpp   Tue Mar 18 07:00:06 2014 +0100
+++ b/src/share/vm/memory/metaspaceTracer.cpp   Thu Mar 20 10:20:04 2014 +0100
@@ -25,6 +25,7 @@
 #include "precompiled.hpp"
 #include "classfile/classLoaderData.hpp"
 #include "memory/metaspaceTracer.hpp"
+#include "oops/oop.inline.hpp"
 #include "trace/tracing.hpp"
 #include "trace/traceBackend.hpp"


Best regards,
  Goetz.

-----Original Message-----
From: hotspot-dev [mailto:hotspot-dev-bounces at openjdk.java.net] On Behalf Of Stefan Karlsson
Sent: Montag, 17. März 2014 13:42
To: Erik Helin; hotspot-dev at openjdk.java.net
Subject: Re: RFR: 8036699: Add trace event when a metaspace allocation fails


On 2014-03-17 13:40, Erik Helin wrote:
> (this reply went to the wrong RFR, reposting to get it back on to the 
> right thread, sorry for the noise)
>
> Based on a discussion with Jon Masamitsu and StefanK, I've decided to 
> change metadata_type_name to return a slightly more user-friendly value.
>
> Please see new webrev at:
> http://cr.openjdk.java.net/~ehelin/8036699/webrev.02/
>
> Incremental webrev:
> http://cr.openjdk.java.net/~ehelin/8036699/webrev.01-02/

The diff looks good.

StefanK

>
> Thanks,
> Erik
>
> On 2014-03-13 17:03, Erik Helin wrote:
>> Hi all,
>>
>> due to lack of reviewers for the native stack trace code, I've decided
>> to split this patch into two patches:
>> - adding the event
>> - adding the native stack trace information the event
>>    (will be sent out later)
>>
>> This review request is now only for adding the event. Please see a new
>> webrev at:
>> http://cr.openjdk.java.net/~ehelin/8036699/webrev.01/
>>
>> For an incremental webrev (that only removes the native stack walking
>> code) please see:
>> http://cr.openjdk.java.net/~ehelin/8036699/webrev.00-01/
>>
>> Thanks,
>> Erik
>>
>> On 2014-03-06 10:00, Erik Helin wrote:
>>> Hi all,
>>>
>>> this patch adds the new trace event vm/gc/metaspace/allocation_failure.
>>> The event will be sent when we get an allocation failure in metaspace.
>>> The event will contain the following information:
>>> - classLoader - the class loader doing the allocation
>>> - anonymousClassLoader - if the classLoader is anonymous
>>> - nativeStackTrace - a VM stack trace (see more below)
>>> - metadataType - the kind of metadata (class or non-class)
>>> - metaspaceObjectType - the kind of metaspace object
>>>
>>> The field nativeStackTrace will contain a string representation of the
>>> Threads C frames (up until the first Java frame). This is very useful
>>> for debugging metaspace allocation failures coming from VM internals
>>> such as the interpreter or GC code.
>>>
>>> I would especially appreciate if someone could look over the code in
>>> metaspaceTracer.cpp performing the stack walking.
>>>
>>> Webrev:
>>> http://cr.openjdk.java.net/~ehelin/8036699/webrev.00/
>>>
>>> Enhancement:
>>> https://bugs.openjdk.java.net/browse/JDK-8036699
>>>
>>> Testing:
>>> - JFR JTREG tests
>>> - JPRT
>>> - Manual stress testing of the stack walking code by writing small test
>>>    programs that causes metaspace allocation failures from both Java
>>>    threads and non-Java threads.
>>>
>>> Thanks,
>>> Erik



More information about the hotspot-dev mailing list