mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8144246: adding lots of directives via jcmd may produce OOM crash
Add a limit to the number of directives Reviewed-by: kvn
This commit is contained in:
parent
e699dcb655
commit
8c0ad215bc
9 changed files with 46 additions and 10 deletions
|
@ -487,6 +487,14 @@ void DirectivesStack::pop_inner() {
|
|||
DirectivesStack::release(tmp);
|
||||
}
|
||||
|
||||
bool DirectivesStack::check_capacity(int request_size, outputStream* st) {
|
||||
if ((request_size + _depth) > CompilerDirectivesLimit) {
|
||||
st->print_cr("Could not add %i more directives. Currently %i/%i directives.", request_size, _depth, CompilerDirectivesLimit);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void DirectivesStack::clear() {
|
||||
// holding the lock during the whole operation ensuring consistent result
|
||||
MutexLockerEx locker(DirectivesStack_lock, Mutex::_no_safepoint_check_flag);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue