OutOfMemory Exception When Uploading Artifacts

Hi There,

I have a task run through the script console which zips up a number of files and then designates that zip as an artifact.
This zip is around 1.5GB, so during the upload, a System.OutOfMemory Exception is thrown.

Fatal 09:14:10
Exception of type ‘System.OutOfMemoryException’ was thrown.
System.OutOfMemoryException: Exception of type ‘System.OutOfMemoryException’ was thrown.
at System.IO.MemoryStream.set_Capacity(Int32 value)
at System.IO.MemoryStream.EnsureCapacity(Int32 value)
at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.Stream.InternalCopyTo(Stream destination, Int32 bufferSize)
at Octopus.Shared.Security.MasterKey.MasterKeyEncryption.ReadAsCiphertext(Byte[] masterKey, Stream plaintext) in y:\work\refs\heads\release\source\Octopus.Shared\Security\MasterKey\MasterKeyEncryption.cs:line 111
at Octopus.Platform.Deployment.Server.Security.MasterKey.DatabaseCommandsExtensions.PutEncryptedAttachment(IDatabaseCommands this, IMasterKeyEncryption encryption, String key, Stream data, RavenJObject metadata, Etag etag) in y:\work\refs\heads\release\source\Octopus.Platform.Deployment.Server\Security\MasterKey\DatabaseCommandsExtensions.cs:line 14
at Octopus.Server.Orchestration.Deploy.ArtifactStorage.StoreArtifact(ReferenceCollection relatedDocuments, String filename, Stream data) in y:\work\refs\heads\release\source\Octopus.Server\Orchestration\Deploy\ArtifactStorage.cs:line 42
at Octopus.Server.Orchestration.Deploy.Collect.ArtifactCollectionOrchestrator.d__5.MoveNext() in y:\work\refs\heads\release\source\Octopus.Server\Orchestration\Deploy\Collect\ArtifactCollectionOrchestrator.cs:line 70
Octopus.Server version 2.6.0.778

Is there a way to increase the amount of memory allocated to the process?
Also, is this exception being thrown by the tentacle or the server? I can’t tell which.

Thanks,
~Ben~

Hi Ben,

Thanks for getting in touch! I don’t have good news. Artifacts aren’t designed for such large files, in fact come 3.0 we will be storing them in the database.
In any attempt to change our mind, could you explain what you are attempting to attatch and why?

Vanessa

That makes sense, we were trying to have some sort of process that would allow us to retrieve files off a server in a programmatic way without having to remote into a machine and copy them manually. Though I doubt that will change your mind, thanks for the info!

Hi Ben,

No problem at all. Yeah you are right, that probably won’t change our mind. You could always add a file that has a link to where this zip is available from - or even create an email step linking to the path but that is all I can think of.

Vanessa