mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 04:24:49 +02:00
8036699: Add trace event when a metaspace allocation fails
Reviewed-by: jmasa, stefank
This commit is contained in:
parent
ddce6492be
commit
b533eca89d
6 changed files with 73 additions and 0 deletions
|
@ -3358,6 +3358,8 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size,
|
|||
MetaWord* result = loader_data->metaspace_non_null()->allocate(word_size, mdtype);
|
||||
|
||||
if (result == NULL) {
|
||||
tracer()->report_metaspace_allocation_failure(loader_data, word_size, type, mdtype);
|
||||
|
||||
// Allocation failed.
|
||||
if (is_init_completed()) {
|
||||
// Only start a GC if the bootstrapping has completed.
|
||||
|
@ -3426,6 +3428,16 @@ void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_s
|
|||
}
|
||||
}
|
||||
|
||||
const char* Metaspace::metadata_type_name(Metaspace::MetadataType mdtype) {
|
||||
switch (mdtype) {
|
||||
case Metaspace::ClassType: return "Class";
|
||||
case Metaspace::NonClassType: return "Metadata";
|
||||
default:
|
||||
assert(false, err_msg("Got bad mdtype: %d", (int) mdtype));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void Metaspace::record_allocation(void* ptr, MetaspaceObj::Type type, size_t word_size) {
|
||||
assert(DumpSharedSpaces, "sanity");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue