You can always raise the maximum amount of memory that can be assigned to your app. If the amount of physical memory in the system is the issue though, then your only option may be to do as you suggest. You might be able to use a GZipStream to store some data in memory in a compressed state, which would likely make access quicker than saving it to disk, but that would not be an option in all circumstances. Note also that, while it's generally to be avoided, you may also find that an explicit call to GC.Collect may help in situations where large amounts of memory are assigned and then are no longer required en masse.