Trim memory usage of FileSystem.
When LoadFromManifest is called, trim the various backing collections. These backing collections tend to live a long time without further modifications.
This commit is contained in:
@@ -186,6 +186,12 @@ namespace OpenRA.FileSystem
|
|||||||
UnmountAll();
|
UnmountAll();
|
||||||
foreach (var kv in manifest.Packages)
|
foreach (var kv in manifest.Packages)
|
||||||
Mount(kv.Key, kv.Value);
|
Mount(kv.Key, kv.Value);
|
||||||
|
|
||||||
|
mountedPackages.TrimExcess();
|
||||||
|
explicitMounts.TrimExcess();
|
||||||
|
modPackages.TrimExcess();
|
||||||
|
foreach (var packages in fileIndex.Values)
|
||||||
|
packages.TrimExcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
Stream GetFromCache(string filename)
|
Stream GetFromCache(string filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user