SharpCrafters Support Forum

        

PostSharp 1.0.12.469 -... Expand / Collapse
Author
Message
Posted 3/6/2009 5:35:23 PM


Community Member
I quite often get the following exception during compilation. There is about 1.5GB of free physical memory on the machine. What's the reason for this exception? Is there a workaround or a fix?

Thanks,
Vitaly

---------------------

PostSharp 1.0 [1.0.12.469] - Copyright (c) Gael Fraiteur, 2005-2008.
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error : Unhandled exception: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.ModuleReader.ModuleReader.CreateArrayOfParameterDeclaration(MetadataTableOrdinal table)
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.ModuleReader.ModuleReader.ReadModule()
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.CodeModel.Domain.LoadAssembly(Assembly reflectionAssembly, Boolean lazyLoading)
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.CodeModel.Domain.GetAssembly(IAssemblyName assemblyName)
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.CodeModel.AssemblyRefDeclaration.GetAssemblyEnvelope()
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.CodeModel.TypeRefDeclaration.GetTypeDefinition(BindingOptions bindingOptions)
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.CodeModel.TypeSpecDeclaration.GetTypeDefinition(BindingOptions bindingOptions)
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.Extensibility.Tasks.IndexGenericInstancesTask.Execute()
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.Extensibility.Project.ExecutePhase(String phase)
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.Extensibility.Project.Execute()
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.Extensibility.PostSharpObject.ExecuteProjects()
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.Extensibility.PostSharpObject.InvokeProjects(ProjectInvocation[] projectInvocations)
C:\Program Files\PostSharp 1.0\PostSharp-1.0.targets(248,5): error :    at PostSharp.MSBuild.PostSharpRemoteTask.Execute(PostSharpTaskParameters parameters, TaskLoggingHelper log)
Post #394
Posted 3/6/2009 7:08:52 PM


Gael Fraiteur

SharpCrafters
I know about this problem, but have never been able to reproduce and analyze it.

Basically, PostSharp is executed everytime in a new application domain. Therefore, there can difficultly be a memory leak since the whole app domain is unloaded.

If you get the problem too often, you can force PostSharp to use the command-line utility by setting the MSBuild property "PostSharpUseCommandLine=True". A new process will be created for each invocation, so there can surely be no memory leak this time!

Yet, if you have the opportunity to analyze the problem, please let me know your conclusions!

-gael
Post #395
Posted 3/6/2009 8:15:24 PM


Community Member
Thanks Gael. Where would one override this property in a .csproj project file? Is it a conditional compilation symbol?
Post #396
Posted 3/7/2009 7:47:54 AM


Gael Fraiteur

SharpCrafters
You can use this in your csproj file:


<PropertyGroup>
   <PostSharpUseCommandLine>True</PostSharpUseCommandLine>
</PropertyGroup>
Post #397
« Prev Topic | Next Topic »

All times are GMT +1:00, Time now is 9:21am