incubator-kato-spec mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Johnson <>
Subject Re: Telling one JavaRuntime from another
Date Thu, 24 Sep 2009 13:40:06 GMT
Steve Poole <> wrote on 23/09/2009 15:36:37:
> Random thought here.
> We've said that in this API you can't use ==  but have to use .equals().
> This is a consequence of the fact that we are trying to squeeze big 
> into small heaps and want to allow implements the ability to only cache 
> they need..    So I was just thinking about how to resolve the question 
> determining if one Javaruntime instance was the same as another.   It's
> horribly possible that for somecases you'd have to do a complete and
> exhaustive graph comparision of all the objects in the runtime instance.
> The JavaRuntime API does't have any method to allow you to get any fast,
> dump unique information -  such as the underlying Image or even a dump
> timestamp.     Given that we want to support the JavaRuntime class as a 
> class entity like Image we need to add something to resolve this 
> How about adding a method to Image and JavaRuntime that returns a unique
> identifer , one that would be different but persistent  (ie you'd get 
> same value if you opened the same dump file)   Maybe then its simply a
> method that exposes the file the dump is read from?
> Cheers
> Steve
I don't see the point. 

The spec. says:
The behaviour of equals against objects from different snapshots is not 

(I'm assuming 'not defined' means returning true or false, not 
doing something perverse.)

so we do not have to worry about Java runtimes from different snapsnots.
Most implementations won't dynamically build JavaRuntimes so they can do a
quick reference comparison in equals().

Also, the getJavaVM() returns a unique pointer. If pointer equality 
the address space and the addresses then the JavaRuntime.equals method can
compare the getJavaVM pointers.

The ImageAddressSpace could do with an unique id (String?, parsable as
long or int if numeric).

I presume if you open a dump twice then those are different snapshots, so
do not have to compare equal.

Andrew Johnson

Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

View raw message