Red Gate forums :: View topic - SmartAssembly 6.6.3 OutOfMemoryException with 64-bit App
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

SmartAssembly 6.6.3 OutOfMemoryException with 64-bit App

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
craigm



Joined: 23 Jun 2010
Posts: 9

PostPosted: Tue Apr 03, 2012 5:06 am    Post subject: SmartAssembly 6.6.3 OutOfMemoryException with 64-bit App Reply with quote

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
View user's profile Send private message
Simon C



Joined: 26 Feb 2008
Posts: 140
Location: Red Gate Software

PostPosted: Tue Apr 03, 2012 9:20 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Simon C



Joined: 26 Feb 2008
Posts: 140
Location: Red Gate Software

PostPosted: Tue Apr 03, 2012 9:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
craigm



Joined: 23 Jun 2010
Posts: 9

PostPosted: Tue Apr 03, 2012 12:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
Simon C



Joined: 26 Feb 2008
Posts: 140
Location: Red Gate Software

PostPosted: Wed Apr 04, 2012 4:51 pm    Post subject: Reply with quote

We're planning on releasing a new version of SA sometime next week. It's currently undergoing final testing.
Back to top
View user's profile Send private message Send e-mail
dom.smith



Joined: 03 Jun 2010
Posts: 94
Location: Cambridge, UK

PostPosted: Thu Apr 12, 2012 12:18 pm    Post subject: Reply with quote

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,
Red Gate Software.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group