Coffeehouse Post

Single Post Permalink

View Thread: Patrick Dussud interview next week: Questions?
  • User profile image

    AndyC wrote:
    Games programming requires a slight shift in mindset. You shouldn't ever get punished by the GC because you shouldn't really be doing any allocations during the critical path. It's all about reserving resources in advance and then reusing them efficiently.
    I agree. But take this scenario. During a level load, I allocate all my objects. Fine. Played the level. Time to load another level. What I would like to do is to "deallocate" the previous level. Do a GC.Collect(true);. Then load the new level.

    I realize that I can unreference the previous level, load the new level, and if there was memory pressure during the new load, a Collect will be done. But I don't know what other factors can create a memory pressure during gameplay.