Developing on the XNA framework for Xbox, I have different 2D image resources being used depending on the level. At the end of a level, I'd like to leave as much loaded as is reasonable, so that the next time a level needs that resource, it's already loaded. However, there will be a great many resources, so I'm assuming that it's a poor idea to leave everything loaded always, simply because memory is limited. Is there a good way to know how much to reasonably unload to keep things running smoothly?
My idea: If the .net garbage collector supported soft references (like the JVM), I could change references to any resources not being explicitly used to soft references, and change them back or reload when they're needed again. That way the garbage collector, who knows the state of memory much better than I, can intelligently drop references as needed when loading new content. In other words, a simple cache. This soft reference construct doesn't exist in C#, however; is there an equivalent or some better way to handle this?