-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8331208: Memory stress test that checks OutOfMemoryError stack trace fails #18925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a711f32
generalized RetryableAllocationMark to SandboxedOOMEMark
dougxc 35e6b50
only support disabling JVMTI events in SandboxedOOMEMark scope
dougxc 137ab23
unconditionally disable JVMTI resource exhausted events in scope of a…
dougxc d99fc56
rename SandboxedOOMEMark to InternalOOMEMark
dougxc 977bdc2
don't perform XX actions for OOME when in scope of an InternalOOMEMark
dougxc 545714a
addressed review comments and suggestions
dougxc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -122,29 +122,29 @@ class ClassAllocator: public MemAllocator { | |||||
| // suppression of JVMTI "resource exhausted" events and | ||||||
| // throwing a shared, backtrace-less OOME instance. | ||||||
| // Used for OOMEs that will not be propagated to user code. | ||||||
| class SandboxedOOMEMark: public StackObj { | ||||||
| class InternalOOMEMark: public StackObj { | ||||||
| private: | ||||||
| bool _outer; | ||||||
| JavaThread* _thread; | ||||||
|
|
||||||
| public: | ||||||
| SandboxedOOMEMark(JavaThread* thread) { | ||||||
| InternalOOMEMark(JavaThread* thread) { | ||||||
|
||||||
| InternalOOMEMark(JavaThread* thread) { | |
| explicit InternalOOMEMark(JavaThread* thread) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,7 +54,7 @@ class ContinuationEntry; | |
| class DeoptResourceMark; | ||
| class JNIHandleBlock; | ||
| class JVMCIRuntime; | ||
| class SandboxedOOMEMark; | ||
| class InternalOOMEMark; | ||
|
||
|
|
||
| class JvmtiDeferredUpdates; | ||
| class JvmtiSampledObjectAllocEventCollector; | ||
|
|
@@ -335,8 +335,8 @@ class JavaThread: public Thread { | |
| // of _attaching_via_jni and transitions to _attached_via_jni. | ||
| volatile JNIAttachStates _jni_attach_state; | ||
|
|
||
| // In scope of a SandboxedOOMEMark? | ||
| bool _in_sandboxed_oome_mark; | ||
| // In scope of an InternalOOMEMark? | ||
| bool _in_internal_oome_mark; | ||
|
|
||
| #if INCLUDE_JVMCI | ||
| // The _pending_* fields below are used to communicate extra information | ||
|
|
@@ -713,8 +713,8 @@ class JavaThread: public Thread { | |
| MemRegion deferred_card_mark() const { return _deferred_card_mark; } | ||
| void set_deferred_card_mark(MemRegion mr) { _deferred_card_mark = mr; } | ||
|
|
||
| bool in_sandboxed_oome_mark() const { return _in_sandboxed_oome_mark; } | ||
| void set_in_sandboxed_oome_mark(bool b) { _in_sandboxed_oome_mark = b; } | ||
| bool in_internal_oome_mark() const { return _in_internal_oome_mark; } | ||
| void set_in_internal_oome_mark(bool b) { _in_internal_oome_mark = b; } | ||
|
|
||
| #if INCLUDE_JVMCI | ||
| jlong pending_failed_speculation() const { return _pending_failed_speculation; } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: add a comment:
I was wondering if we really need this. AFAICS it would be harmless to always pass in the current thread and set the thread's field because when we would have passed null then no exception would be thrown anyway. It seems the null thread is only used as a means for RAM to track whether activate was false. But I guess a no-op IOM achieves the same goal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throwing of the OOME is never suppressed by InternalOOMEMark. It only changes how the OOME is initialized.
When RetryableAllocationMark passes
thread == null, it wants the normal OOME initialization to be done and JVMTI events to be fired.In the context of https://bugs.openjdk.org/browse/JDK-8331429, I propose to leave this PR as is. That issue will remove
activatealtogether (cc @mur47x111 ).