On 02/25/2013 05:30 PM, Nils Loodin wrote:
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.
These are just suggestions... thinking loud ...
Other hierarchical names for counters use two common forms (note
plural/singular):
sun.classloader.findClassTime
sun.classloader.findClasses
sun.classloader.parentDelegationTime
or:
java.threads.daemon
java.threads.live
java.threads.livePeak
java.threads.started
So by these forms, the name could be:
sun.throwable.numThrowables
or:
sun.throwables.num[ber]
might be later changed to (if instrumented to increment at construction
time and/or throw time):
sun.throwables.constructed
sun.throwables.thrown
until then, it could be simply:
sun.throwables
Regards, Peter
Regards,
Nils Loodin