SmartAssembly 6.6.3 OutOfMemoryException with 64-bit App

craigmcraigm Posts: 17
edited April 12, 2012 7:18AM in SmartAssembly
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:
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

Comments

  • 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.
  • 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.
  • 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
  • We're planning on releasing a new version of SA sometime next week. It's currently undergoing final testing.
  • 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,
    Project Manager,
    Redgate.
Sign In or Register to comment.