On Fri, Dec 18, 2009 at 6:23 PM, John Cowan <[email protected]> wrote:
> On Fri, Dec 18, 2009 at 7:19 PM, Charles Oliver Nutter
> <[email protected]> wrote:
>> I figured I'd do a feasibility study on whether JDI could be used to
>> implement ObjectSpace (Ruby's feature for walking all objects on the
>> heap of a given class).
>
> Wouldn't maintaining a weak set initialized by the constructor be preferable?

That's what we do now, but I'd like to just rip that code completely
out so we don't have to check a flag "should I add myself or not". And
the weakref method means you have n * <ruby object count> extra
objects in memory, along with the tremendous perf hit of constructing
a weakref for every ruby object construction.

In the end, this is too slow, so it's only an interesting JDI hack.
But it's cute :)

I may look into a JVMTI version instead, since it would be a lot
closer to the metal and we may be able to bind the JNI methods
dynamically using JRuby's FFI layer.

- Charlie

--

You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en.


Reply via email to