Mercurial > hg > graal-compiler
comparison src/share/vm/memory/metaspaceTracer.cpp @ 17769:bc7714614ad8
8036699: Add trace event when a metaspace allocation fails
Reviewed-by: jmasa, stefank
author | ehelin |
---|---|
date | Fri, 21 Mar 2014 10:20:00 +0100 |
parents | daef39043d2c |
children | 5af31f70a866 |
comparison
equal
deleted
inserted
replaced
17768:daef39043d2c | 17769:bc7714614ad8 |
---|---|
21 * questions. | 21 * questions. |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #include "precompiled.hpp" | 25 #include "precompiled.hpp" |
26 #include "classfile/classLoaderData.hpp" | |
26 #include "memory/metaspaceTracer.hpp" | 27 #include "memory/metaspaceTracer.hpp" |
27 #include "trace/tracing.hpp" | 28 #include "trace/tracing.hpp" |
28 #include "trace/traceBackend.hpp" | 29 #include "trace/traceBackend.hpp" |
29 | 30 |
30 void MetaspaceTracer::report_gc_threshold(size_t old_val, | 31 void MetaspaceTracer::report_gc_threshold(size_t old_val, |
36 event.set_newValue(new_val); | 37 event.set_newValue(new_val); |
37 event.set_updater((u1)updater); | 38 event.set_updater((u1)updater); |
38 event.commit(); | 39 event.commit(); |
39 } | 40 } |
40 } | 41 } |
42 | |
43 void MetaspaceTracer::report_metaspace_allocation_failure(ClassLoaderData *cld, | |
44 size_t word_size, | |
45 MetaspaceObj::Type objtype, | |
46 Metaspace::MetadataType mdtype) const { | |
47 EventMetaspaceAllocationFailure event; | |
48 if (event.should_commit()) { | |
49 if (cld->is_anonymous()) { | |
50 event.set_classLoader(NULL); | |
51 event.set_anonymousClassLoader(true); | |
52 } else { | |
53 if (cld->is_the_null_class_loader_data()) { | |
54 event.set_classLoader((Klass*) NULL); | |
55 } else { | |
56 event.set_classLoader(cld->class_loader()->klass()); | |
57 } | |
58 event.set_anonymousClassLoader(false); | |
59 } | |
60 | |
61 event.set_size(word_size * BytesPerWord); | |
62 event.set_metadataType((u1) mdtype); | |
63 event.set_metaspaceObjectType((u1) objtype); | |
64 event.commit(); | |
65 } | |
66 } |