RFR(S): 8037842: Failing to allocate MethodCounters and MDO causes a serious performance drop

John Rose john.r.rose at oracle.com
Tue Oct 21 20:37:36 UTC 2014


On Oct 17, 2014, at 6:18 AM, Albert Noll <albert.noll at oracle.com> wrote:

> Here is the webrev for Solution 1. Please note that I am not familiar with this part of the code.
> 
> http://cr.openjdk.java.net/~anoll/8037842/webrev.00/

Per previous messages, we should work on solution #2.

Also, the code changes for solution #1 look wrong to me, in that they appear to "tunnel" exceptions through C function calls which do *not* have "TRAPS" in their signature.

This is historically a rich source of bugs, since it is a non-local effect.  If a second exception gets thrown while the first is in transit, you may get a crash.

Another observed bug is dangling managed pointers, since "TRAPS" functions may block and cause GCs.  If you have a TRAPS function E calling a non-TRAPS function F calling a TRAPS function G, then raw oops in E are at risk of being broken during the call to G, because the author of E had no easy way to know the GC might have happened during the call to E.

Regarding the CLEAR_PENDING_EXCEPTION macro, if you use it you have to really return normally or generate a new exception.

Conversely, if you don't use it, you must use the CHECK macro (or similar) after any TRAPS function to propagate any current exception.

— John


More information about the hotspot-dev mailing list