Does WinRT have Garbage Collection?
Or does it do reference counting as does COM?
In the common language runtime (CLR), the garbage collector (GC) serves as an automatic memory manager. The garbage collector manages the allocation and release of memory for an application. For developers working with managed code, this means that you don't have to write code to perform memory management tasks.
Another very fast approach is to have dedicated object pools for different classes of object. Released objects can just be recycled in the pool, using something like a linked list of free object slots. Operating systems often used this kind of approach for common data structures.
(1) Garbage collection is a function of an operating system or programming language that reclaims memory no longer in use. For example, Java and . NET have built-in garbage collection, but C and C++ do not, and programmers have to write the code to allocate and deallocate, which is tedious and error prone.
I found this article, which cites Microsoft's Martyn Lovell:
"WinRT objects are reference counted like COM for memory management, with weak references to avoid circularity."
Apparently this was mentioned at his talk on WinRT internals at the BUILD convention.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With