diff options
author | Justin Clarke Casey | 2009-05-14 20:37:54 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-05-14 20:37:54 +0000 |
commit | 62771560448edbc2112d427acd4b37780dfe2154 (patch) | |
tree | ba07c1ae1d8de5e24e24a013fcaa39ade898f039 /OpenSim/Region/CoreModules/Avatar | |
parent | * refactor: move SceneXmlLoader into subpackage (diff) | |
download | opensim-SC_OLD-62771560448edbc2112d427acd4b37780dfe2154.zip opensim-SC_OLD-62771560448edbc2112d427acd4b37780dfe2154.tar.gz opensim-SC_OLD-62771560448edbc2112d427acd4b37780dfe2154.tar.bz2 opensim-SC_OLD-62771560448edbc2112d427acd4b37780dfe2154.tar.xz |
* When saving an oar, save assets when immediately received rather than storing them all up in memory
* Hopefully this will remove out of memory problems when saving large oars on machines without much memory
* It may also speed up saving of large oars
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index b5c0d86..fec2425 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
56 | private InventoryArchiverModule m_module; | 56 | private InventoryArchiverModule m_module; |
57 | private CachedUserInfo m_userInfo; | 57 | private CachedUserInfo m_userInfo; |
58 | private string m_invPath; | 58 | private string m_invPath; |
59 | protected TarArchiveWriter m_archive; | 59 | protected TarArchiveWriter m_archiveWriter; |
60 | protected UuidGatherer m_assetGatherer; | 60 | protected UuidGatherer m_assetGatherer; |
61 | 61 | ||
62 | /// <value> | 62 | /// <value> |
@@ -100,17 +100,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
100 | m_assetGatherer = new UuidGatherer(m_module.CommsManager.AssetCache); | 100 | m_assetGatherer = new UuidGatherer(m_module.CommsManager.AssetCache); |
101 | } | 101 | } |
102 | 102 | ||
103 | protected void ReceivedAllAssets(IDictionary<UUID, AssetBase> assetsFound, ICollection<UUID> assetsNotFoundUuids) | 103 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) |
104 | { | 104 | { |
105 | AssetsArchiver assetsArchiver = new AssetsArchiver(assetsFound); | ||
106 | assetsArchiver.Archive(m_archive); | ||
107 | |||
108 | Exception reportedException = null; | 105 | Exception reportedException = null; |
109 | bool succeeded = true; | 106 | bool succeeded = true; |
110 | 107 | ||
111 | try | 108 | try |
112 | { | 109 | { |
113 | m_archive.Close(); | 110 | m_archiveWriter.Close(); |
114 | } | 111 | } |
115 | catch (IOException e) | 112 | catch (IOException e) |
116 | { | 113 | { |
@@ -133,7 +130,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
133 | saveItem.CreatorId = OspResolver.MakeOspa(saveItem.CreatorIdAsUuid, m_module.CommsManager); | 130 | saveItem.CreatorId = OspResolver.MakeOspa(saveItem.CreatorIdAsUuid, m_module.CommsManager); |
134 | 131 | ||
135 | string serialization = UserInventoryItemSerializer.Serialize(saveItem); | 132 | string serialization = UserInventoryItemSerializer.Serialize(saveItem); |
136 | m_archive.WriteFile(filename, serialization); | 133 | m_archiveWriter.WriteFile(filename, serialization); |
137 | 134 | ||
138 | m_assetGatherer.GatherAssetUuids(saveItem.AssetID, (AssetType)saveItem.AssetType, m_assetUuids); | 135 | m_assetGatherer.GatherAssetUuids(saveItem.AssetID, (AssetType)saveItem.AssetType, m_assetUuids); |
139 | } | 136 | } |
@@ -156,7 +153,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
156 | inventoryFolder.ID); | 153 | inventoryFolder.ID); |
157 | 154 | ||
158 | // We need to make sure that we record empty folders | 155 | // We need to make sure that we record empty folders |
159 | m_archive.WriteDir(path); | 156 | m_archiveWriter.WriteDir(path); |
160 | } | 157 | } |
161 | 158 | ||
162 | List<InventoryFolderImpl> childFolders = inventoryFolder.RequestListOfFolderImpls(); | 159 | List<InventoryFolderImpl> childFolders = inventoryFolder.RequestListOfFolderImpls(); |
@@ -265,7 +262,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
265 | inventoryItem = m_userInfo.RootFolder.FindItemByPath(m_invPath); | 262 | inventoryItem = m_userInfo.RootFolder.FindItemByPath(m_invPath); |
266 | } | 263 | } |
267 | 264 | ||
268 | m_archive = new TarArchiveWriter(m_saveStream); | 265 | m_archiveWriter = new TarArchiveWriter(m_saveStream); |
269 | 266 | ||
270 | if (null == inventoryFolder) | 267 | if (null == inventoryFolder) |
271 | { | 268 | { |
@@ -298,7 +295,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
298 | } | 295 | } |
299 | 296 | ||
300 | SaveUsers(); | 297 | SaveUsers(); |
301 | new AssetsRequest(m_assetUuids.Keys, m_module.CommsManager.AssetCache, ReceivedAllAssets).Execute(); | 298 | new AssetsRequest( |
299 | new AssetsArchiver(m_archiveWriter), m_assetUuids.Keys, | ||
300 | m_module.CommsManager.AssetCache, ReceivedAllAssets).Execute(); | ||
302 | } | 301 | } |
303 | 302 | ||
304 | /// <summary> | 303 | /// <summary> |
@@ -316,7 +315,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
316 | 315 | ||
317 | if (creator != null) | 316 | if (creator != null) |
318 | { | 317 | { |
319 | m_archive.WriteFile( | 318 | m_archiveWriter.WriteFile( |
320 | ArchiveConstants.USERS_PATH + creator.UserProfile.Name + ".xml", | 319 | ArchiveConstants.USERS_PATH + creator.UserProfile.Name + ".xml", |
321 | UserProfileSerializer.Serialize(creator.UserProfile)); | 320 | UserProfileSerializer.Serialize(creator.UserProfile)); |
322 | } | 321 | } |