RFR: 8007806: Need a Throwables performance counter
Nils Loodin
nils.loodin at oracle.com
Mon Feb 25 16:30:25 UTC 2013
On 02/25/2013 02:30 PM, Peter Levart wrote:
> On 02/25/2013 10:29 AM, Nils Loodin wrote:
>> On 02/24/2013 11:18 PM, David Holmes wrote:
>>> We've not-so-slightly hijacked Nils' thread here - apologies for that.
>>
>> David, Peter!
>>
>> Yes you did :)
>> However, feel free to make it up to me by:
>> 1. Suggest a good name for the counter
>
> As Jason Mehrens pointed out in this thread, the "thrownThrowables"
> might be misleading if the counter is incremented in the Throwable
> constructors (or are you going to instrument the throw sites?). So it
> might better be called what it is: "constructedThrowables". Yes, this
> is a common idiom:
>
> throw new ThrowableSubclass(...);
>
> ...but the number of thrown and constructed throwables may diverge
> considerably in situations like for example:
>
> - preallocated throwable instances used (and reused) as a form of
> "long return" (from lambdas).
> - deserialized throwables on RMI clients that are thrown on the server
> side, transfered over the wire and re-thrown on client side
> (de-seriailization does not call the constructor)
>
I changed it to
sun.throwables.numThrowables
in http://cr.openjdk.java.net/~nloodin/8007806/webrev.01/
Is this better? However, bear in mind that it's not exactly specified
where this is going to be incremented from yet. Nothing in this change
states that it's going to be incremented from the Throwable constructor.
Regards,
Nils Loodin
More information about the core-libs-dev
mailing list