I\'m trying to write a simple Resource Manager for the little hobby game I\'m writing. One of the tasks that this resource manager needs to do is unloading unused resources.
As already told by other users, what you are trying to achieve is already made by the GC, and can be fine tuned using a WeakReference.
This imply that in managed environments like .NET, java, and so on, this is a non-problem.
Since the low-level framework architecture isolates you from the memory management, if you still need for that kind of functionality, I strongly suggest you to review your own code architecture, cause it would mean that you are doing some sort of bad-practise in memory management