Heap walking is not supported AFAIK. You could, in theory, implement
this feature by extending the garbage collector, but this would require
some big mono hacking, which I think you should avoid.<br>
>From the performance point of view, using finalizer is make for sense for what you require, since the GC only have to worry about a small
bunch of objects and your application won't perform full heap scan,
which is a operation with a high cost. Using finalizer should be even
better once mono ships with sgen as default. Sgen is a generational
garbage collector and most of time it only scans a fraction of the heap.
This means that it would process finalizers at a lower cost than
performing the full heap scans you have sugested.<br>
<br>Anyway, it's not a good practice to rely on the GC to perform resources management, as it doesn't provide any hard guarantees about when they will be freed. This could lead to file descriptor exaction or sub-optimal system performance. The best way is to let the application do manual resource management. It's not that hard and produces better result. In your example, it could have a queue that it's processed at specific times.
Rodrigo Kumpera<br><br><br><br><div><span class="gmail_quote">On 7/2/07, <b class="gmail_sendername">Joachim Ante</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>Is there any way from managed or unmanaged code to iterate through<br>all allocated managed objects?<br>I presume the Garbage collector must have this data somewhere?<br><br>I basically want to see which objects are being referenced and then
<br>unload some unmanaged data based on it.<br>I don't want to override the finalizer for performance reasons. In<br>our situation there are specific times where i can just spend a bunch<br>of time on cleanup.<br><br>
Joachim Ante<br>_______________________________________________<br>Mono-devel-list mailing list<br><a href="mailto:Monofirstname.lastname@example.org">Monoemail@example.com</a><br><a href="http://lists.ximian.com/mailman/listinfo/mono-devel-list">