| Author |
Message |
craigm
Joined: 23 Jun 2010 Posts: 9
|
Posted: Tue Apr 03, 2012 5:06 am Post subject: SmartAssembly 6.6.3 OutOfMemoryException with 64-bit App |
|
|
Hi,
I'm having issues with version 6.6.3 of SmartAssembly when trying to generate a 64-bit version of my application. It seems to be running out of memory at a similar point it would if it were a 32-bit application. It works fine without processing through SmartAssembly, but once I process it, it throws an out of memory exception, even if all of the options are turned off (no obfuscation, pruning, control flow, etc).
I was able to reproduce this program with a simple command line application with the following code:
| Code: |
class Program
{
static void Main(string[] args)
{
try
{
var l = new List<object>();
for (int i = 1; i <= 4096; i++)
{
l.Add(new A());
Console.WriteLine("Created " + i.ToString("#,##0") + "MB");
}
Console.WriteLine("No out of memory exception.");
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
Console.WriteLine((Environment.Is64BitProcess ? "64" : "32") + "-bit process");
Console.ReadKey();
}
}
class A
{
byte[] b;
public A()
{
b = new Byte[1048576];
}
}
|
I've reverted to version 6.1 and it seems to be working fine so I'm going to use this in the meantime.
Thanks,
Craig |
|
| Back to top |
|
 |
Simon C
Joined: 26 Feb 2008 Posts: 140 Location: Red Gate Software
|
Posted: Tue Apr 03, 2012 9:20 am Post subject: |
|
|
| Thanks for the test case, I've reproduced it on my machine, however only if the application is specifically compiled for 64-bit. AnyCPU works fine, which is probably why we haven't picked this up yet. |
|
| Back to top |
|
 |
Simon C
Joined: 26 Feb 2008 Posts: 140 Location: Red Gate Software
|
Posted: Tue Apr 03, 2012 9:33 am Post subject: |
|
|
| I've just checked in a fix. We weren't setting the large address aware flag on the PE header of the assembly, which (for some reason) is required on 64-bit assemblies but not 32-bit or AnyCPU. This'll be in the next release of SA. |
|
| Back to top |
|
 |
craigm
Joined: 23 Jun 2010 Posts: 9
|
Posted: Tue Apr 03, 2012 12:07 pm Post subject: |
|
|
Thanks for looking at this for us. Do you have any idea on when I could expect a new version to be released?
Thanks,
Craig |
|
| Back to top |
|
 |
Simon C
Joined: 26 Feb 2008 Posts: 140 Location: Red Gate Software
|
Posted: Wed Apr 04, 2012 4:51 pm Post subject: |
|
|
| We're planning on releasing a new version of SA sometime next week. It's currently undergoing final testing. |
|
| Back to top |
|
 |
dom.smith
Joined: 03 Jun 2010 Posts: 64 Location: Cambridge, UK
|
Posted: Thu Apr 12, 2012 12:18 pm Post subject: |
|
|
Hi,
I've just released SmartAssembly 6.6.4.95, which includes this fix. To download it, use 'Check for Updates' in SmartAssembly's menu.
Thanks for telling us about the bug.
Dom. _________________ Dominic Smith,
ANTS Performance Profiler Project Manager,
.NET Division, Red Gate Software. |
|
| Back to top |
|
 |
|