× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



If, however, you're taking about deallocating memory that was
programactially allocated by the application, then no GC routine in
existence can clean that up ... as only the application knows what is
still in use.

But in a managed environment you don't allocate "memory" you allocate
objects. If you needed 200K of memory for <insert you need here> you
wouldn't alloc it, you'd create a new byte[] object, or perhaps a
MemoryStream. Then these are objects, and the GC will know when they are
no longer referenced and can be cleaned up.

The only spot the GC needs help is when you're transitioning to
non-managed code. If you allocate memory and then need to pass a pointer
to that memory to non-managed code, then you need to tell the GC to pin
the memory and leave it alone. The GC can tell when managed code is
using the memory, it can't tell when non-managed code is using it.
Therefore you must then un-pin the memory when it's no longer needed in
the called code.

-Walden


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.