System.OutOfMemoryException
rantox
Posts: 8
Hello, I'm trying to release a package on my local machine and I get this error:
Execute step RESULTSETPACK version 1.0.0 against machine LOCAL
2013-08-12 12:40:57 INFO Evaluating deployment variables
2013-08-12 12:40:57 INFO Begin deployment
2013-08-12 12:40:57 DEBUG Deploying package RESULTSETPACK 1.0.0 to agent http://localhost:10301/
2013-08-12 12:41:05 ERROR Deployment on the Agent failed.
2013-08-12 12:41:05 INFO Agent output follows:
2013-08-12 12:40:57 DEBUG Begin deployment of package: RESULTSETPACK.1.0.0
2013-08-12 12:40:57 DEBUG Deployment Agent information is below:
2013-08-12 12:40:57 DEBUG - Machine name: DEV-01
2013-08-12 12:40:57 DEBUG - Is 64-bit: False
2013-08-12 12:40:57 DEBUG - Service user name: SYSTEM
2013-08-12 12:40:57 DEBUG - CLR version: 4.0.30319.225
2013-08-12 12:40:57 DEBUG - Current directory: C:\Windows\system32
2013-08-12 12:40:57 DEBUG - OS version: Microsoft Windows NT 6.1.7600.0
2013-08-12 12:40:57 DEBUG - Agent version: 2.1.8.8
2013-08-12 12:40:57 DEBUG Installing package RESULTSETPACK.1.0.0 from uploaded package cache into C:\ProgramData\Red Gate\DeploymentAgent\Applications\MyDev\RESULTSETPACK\1.0.0
2013-08-12 12:41:04 ERROR Error while executing job: Exception of type 'System.OutOfMemoryException' was thrown.
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
Server stack trace:
at System.IO.MemoryStream.ToArray()
at NuGet.StreamExtensions.ToStreamFactory(Stream stream)
at NuGet.ZipPackageFile..ctor(PackagePart part)
at NuGet.ZipPackage.<GetFilesNoCache>b__11(PackagePart part)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at NuGet.ZipPackage.GetFilesNoCache()
at System.Lazy`1.CreateValue()
Exception rethrown at [0]:
at System.IO.MemoryStream.ToArray()
at NuGet.StreamExtensions.ToStreamFactory(Stream stream)
at NuGet.ZipPackageFile..ctor(PackagePart part)
at NuGet.ZipPackage.<GetFilesNoCache>b__11(PackagePart part)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at NuGet.ZipPackage.GetFilesNoCache()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at NuGet.MemoryCache.GetOrAdd[T](Object cacheKey, Func`1 factory, TimeSpan expiration, Boolean absoluteExpiration)
at NuGet.ZipPackage.GetFilesBase()
at NuGet.ZipPackage.GetAssembliesNoCache()
at System.Lazy`1.CreateValue()
Exception rethrown at [1]:
at System.IO.MemoryStream.ToArray()
at NuGet.StreamExtensions.ToStreamFactory(Stream stream)
at NuGet.ZipPackageFile..ctor(PackagePart part)
at NuGet.ZipPackage.<GetFilesNoCache>b__11(PackagePart part)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at NuGet.ZipPackage.GetFilesNoCache()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at NuGet.MemoryCache.GetOrAdd[T](Object cacheKey, Func`1 factory, TimeSpan expiration, Boolean absoluteExpiration)
at NuGet.ZipPackage.GetFilesBase()
at NuGet.ZipPackage.GetAssembliesNoCache()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at System.Lazy`1.get_Value()
at NuGet.MemoryCache.GetOrAdd[T](Object cacheKey, Func`1 factory, TimeSpan expiration, Boolean absoluteExpiration)
at NuGet.ZipPackage.GetAssemblyReferencesBase()
at NuGet.LocalPackage.get_AssemblyReferences()
at NuGet.PackageExtensions.HasProjectContent(IPackage package)
at NuGet.PackageWalker.GetPackageTarget(IPackage package)
at NuGet.PackageWalker.GetPackageInfo(IPackage package)
at NuGet.PackageWalker.ProcessPackageTarget(IPackage package)
at NuGet.PackageWalker.Walk(IPackage package)
at NuGet.InstallWalker.ResolveOperations(IPackage package)
at NuGet.PackageManager.Execute(IPackage package, IPackageOperationResolver resolver)
at NuGet.PackageManager.InstallPackage(IPackage package, FrameworkName targetFramework, Boolean ignoreDependencies, Boolean allowPrereleaseVersions)
at NuGet.PackageManager.InstallPackage(IPackage package, Boolean ignoreDependencies, Boolean allowPrereleaseVersions)
at NuGet.PackageManager.InstallPackage(String packageId, SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions)
at RedGate.Deploy.Agent.Deployment.Packages.PackageInstaller.InstallPackageUsingNuGet(IPackageMetadata package, SemanticVersion version, String packageInstallationPath, String packageUploadPath)
at RedGate.Deploy.Agent.Deployment.Packages.PackageInstaller.Install(IPackageMetadata package, IPackageInstallationOptions options)
at RedGate.Deploy.Agent.Deployment.DeploymentController.Execute(PackageMetadata package, IVariableDictionary variables)
at RedGate.Deploy.Agent.Services.Jobs.DeployPackageJobExecutor.Execute(DeployPackageJob job)
at CallSite.Target(Closure , CallSite , Object , Object )
at RedGate.Deploy.Agent.Services.Jobs.JobQueue.RunDeployments(Object ignored)
2013-08-12 12:41:04 DEBUG Purged 0 sends older than 1.00:00:00.
2013-08-12 12:41:04 WARN Report last sent at 08/12/2013 12:38:47. Report send skipped.
Comments
We rely on NuGet packages to do our deployments. The total memory use depends on how NuGet unzips a package (we unzip the package on the Agent before installing it). We have had an issue with NuGet before as it tries to load a significant chunk of the package into memory during install and of course, the decompression also expands the package size.
May I also ask, what type of package are you deploying, is it a database package with static data?
Software Engineer - Deployment Manager
Red Gate
It might take longer than a usual Deployment Manager bug fix though as it will require modifying NuGet library and for our request to be accepted.
Software Engineer - Deployment Manager
Red Gate
Software Engineer - Deployment Manager
Red Gate
Please make sure to upgrade the server and your agents to benefit from this fix.