RFR: 8267118: OutOfMemoryError cannot be caught as a Throwable [v3]
David Holmes
dholmes at openjdk.java.net
Tue Jun 1 23:29:28 UTC 2021
On Tue, 1 Jun 2021 23:08:28 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> The problem is that debug logging is step-by-step information, while the Info logging is a complete statement. So the Info message does not fit with the previous debug messages, hence the either-or approach.
>
> Logging is supposed to be non-invasive in the source code, which is why it was defined ideally to have one line like log_info(tag)(string)
> Here it seems to dominate the code in this method. Anything to make it shorter and less invasive would be better so that you can see how the code is actually finds the exception handler. I only made a small request for simplification. I think the formatting of the log messages wouldn't be bad if the info line is printed rather than the debug line.
>
> [0.208s][debug][exceptions] Looking for catch handler for exception of type "java.lang.Error" in method "main"
> [0.208s][debug][exceptions] - checking exception table entry for BCI 0 to 3
> [0.208s][debug][exceptions] - entry covers throw point BCI 0
> [0.208s][debug][exceptions] - found catch-all handler at BCI: 14
>
> Would be:
>
> [0.208s][debug][exceptions] Looking for catch handler for exception of type "java.lang.Error" in method "main"
> [0.208s][debug][exceptions] - checking exception table entry for BCI 0 to 3
> [0.208s][debug][exceptions] - entry covers throw point BCI 0
> [0.198s][info ][exceptions] Found catch-all handler for exception of type "java.lang.Error" in method "main" at BCI: 14
>
> I don't think this looks bad at all and worth not having special if statement for debug/info logging. That's 6 lines saved in this 96 line function.
Okay I will redo this.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4266
More information about the hotspot-runtime-dev
mailing list