mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8208686: [AOT] JVMTI ResourceExhausted event repeated for same allocation
Reviewed-by: never, kvn, sspitsyn
This commit is contained in:
parent
2223e083ba
commit
548eb6860a
20 changed files with 348 additions and 141 deletions
|
@ -611,6 +611,20 @@ Klass* Klass::array_klass_impl(bool or_null, TRAPS) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void Klass::check_array_allocation_length(int length, int max_length, TRAPS) {
|
||||
if (length > max_length) {
|
||||
if (!THREAD->in_retryable_allocation()) {
|
||||
report_java_out_of_memory("Requested array size exceeds VM limit");
|
||||
JvmtiExport::post_array_size_exhausted();
|
||||
THROW_OOP(Universe::out_of_memory_error_array_size());
|
||||
} else {
|
||||
THROW_OOP(Universe::out_of_memory_error_retry());
|
||||
}
|
||||
} else if (length < 0) {
|
||||
THROW_MSG(vmSymbols::java_lang_NegativeArraySizeException(), err_msg("%d", length));
|
||||
}
|
||||
}
|
||||
|
||||
oop Klass::class_loader() const { return class_loader_data()->class_loader(); }
|
||||
|
||||
// In product mode, this function doesn't have virtual function calls so
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue