Re: Win32OLE: Output parameters, Dispatch IDs



x1 wrote:
> I have not been able to figure anything out yet myself.

I figured.

> Do you know off hand how one would be able to find any variable
> names(if exist) that are pointing to a given object?

Just last week, Joel VanderWerf wrote, in "Re: Memory Leaks: How to see GC
Roots?":
> There's a ruby patch to show what objects are reachable from the roots
> (and the chain of references in each case):
>
> http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/151854?151368-152549
>
> It should easy to modify it to just show the roots.

In the same thread, Stephen Kellett posted a link to a product called Ruby
Memory Validator, which lists as a feature "References view. Display the
object reference graph for the application," and the screenshot looks like
it would deal well with this issue.
http://www.softwareverify.com/rubyMemoryValidator/feature.html

I have not actually operated either of these two possible solutions.

> For instance when looking at ObjectSpace.cantremembermethodname(Array)
> You get something like:
> ["notepad", nil, nil, 333]
>
> How would one be able to determine the object id and / or any variable
> names associated with it?

But, it just occurred to me, you could cheat and do something like this to
get the array:
pid = nil
ObjectSpace.each_object(Array) do |arr|
pid = arr[3] if arr.size == 4 && arr[0, 3] == ["notepad", nil, nil]
end

There you go - recover it from the object pool without knowing where the
references to it are/were.

Cheers,
Dave


.



Relevant Pages

  • Re: Does This Series Look Familiar?
    ... please note i have been looking for references now ... roots of f_, and I'd like to find the roots for ... of these polynomials. ... I'll go take a look at your archived posts now. ...
    (sci.math)
  • Re: Win32OLE: Output parameters, Dispatch IDs
    ... "notepad" are running simultaneously. ... >> There's a ruby patch to show what objects are reachable from the roots ... which lists as a feature "References view. ...
    (comp.lang.ruby)
  • Re: Elsethread (was: Re: Arkansas)
    ... I know what "upthread" means. ... from what you see on your server. ... So references to "earlier" are only ... my newsreader, for example, the roots are at the left and the leaves ...
    (alt.usage.english)
  • Re: Einsteins Doppler equation wrong?
    ... > You've never created the Mandelbrot set for yourself, ... > You'll find A and B are the other two cube roots of 1. ... > One coulomb per second per cubic metre perhaps? ... I already presented you with references in ...
    (sci.physics.relativity)
  • Re: Memory leak - Forms with Owners
    ... There's a memory leaks when removing owned forms, ... owner of, and the order they are removed from the owner. ... There's no need to set the Form2 ... references to null, since the variable will go out of scope when the method ...
    (microsoft.public.dotnet.framework.windowsforms)