JDK-8222893 fixed a bug due to the usage of a ResourceMark in a print function. The RFR [1] states that:
"print functions with outputStream should not have a ResourceMark because you could call it with a LogStream or stream that was allocated outside the resource mark. The caller needs the ResourceMark."
As a follow-up, we should take a closer look at other print functions with an outputStream argument which also define a ResourceMark like Klass::print_on(outputStream*) and clean these up.
[1] https://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2019-May/034095.html