A collection of Objects?

  • Thread starter Thread starter RSH
  • Start date Start date
R

RSH

Is there a way to iterate through all of the active objects in memory? Or
do I need to add the objects to a collection upon instantiation and do it
that way?

Ron
 
What are you trying to accomplish with this?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
I can tell by your response that this is not a recommended practice.

I will look for a better approach.
 
Hi,


RSH said:
Is there a way to iterate through all of the active objects in memory? Or
do I need to add the objects to a collection upon instantiation and do it
that way?

No, the GC does ont provide nothing that let you iterate through all the
objects currently instantiated in the heap ( not even speaking of those in
the stack )

What are you trying to do?
 
"RSH" <[email protected]> a écrit dans le message de (e-mail address removed)...

| Is there a way to iterate through all of the active objects in memory? Or
| do I need to add the objects to a collection upon instantiation and do it
| that way?

You would never want to iterate through *all* the active objects in memory,
that would *really* take some time :-))

If you want to iterate through all the objects of one particular type, then
that would make more sense and, yes you would add them to a collection
rather than having a vast number lying around in disparate places in your
code; some of which could well be out of scope to the place that you want to
iterate them from.

What kind of reason do you have in mind for wanting to do this ?

Joanna
 
Well, if you could tell us your requreiments, we could suggest some possible
solutions.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.
 
Back
Top