2

is there difference between max memory 32 bit and 64 bit .net frameworks? I mean: can I allocate more than 2GB memory when writing on 64 bit .net framework?

what is features of 64 bit .net framework? I cant find it on internet.

Zviadi
  • 731
  • 2
  • 8
  • 19

3 Answers3

2

From this post, it looks like they removed the max 2GB and you can use all memory available.

x64 has the following pros:

  1. No 2GB memory limit - you can use all of the memory available.
  2. Potential for better perf., especially with some double precision math. x64 has a couple of extra registers, and can do some things faster (potentially). I've seen some significant boosts in some highly numerical code, but for most business applications, you won't see a difference.

x64 has the following cons:

  1. Less than ideal IDE support
  2. Program takes more memory (object references 2x size)

Looking at Migrating 32-bit Managed Code to 64-bit might be helpful as well.

SwDevMan81
  • 48,814
  • 22
  • 151
  • 184
  • 1
    IIRC the limit is 3GB if you enable the 3GB switch on the PE – Marc Gravell Jan 31 '11 at 12:37
  • Re "IDE support" - that is less true all the time. There are some tools that are still problematic, but for most things: fine. – Marc Gravell Jan 31 '11 at 12:40
  • @Marc Gravell: True, and if I understand http://msdn.microsoft.com/en-us/library/ff556232.aspx correctly, the limit will even be 4GB for 32-bit processes on a x64 system (from Windows Server 2003 SP1 on). – Dirk Vollmar Jan 31 '11 at 12:43
1

Yes, you can allocate as much memory as your system will allow before crumpling under the weight - however, arrays (which includes most lists) and strings etc are still limited to 2GB. Note also that since the size of a reference doubles, this means you can only have half as many references in a list. But that is still a lot of references.

The sizes of int etc don't change, since they are fixed regardless of the platform.

You may also see other oddities - x64 and x86 have some different optimisations in the engine. So please do test - don't just change it to x64 and blindly deploy. Examples here would be tail call and various things surrounding complex cases like volatile.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
1

In my experience, in practice, the program uses almost twice as much memory on 64 bit system. No other issues so far. (Mine is a set of ~30 windows services crunching some data using an ORM -- hence the many object references).

Andriy Volkov
  • 18,653
  • 9
  • 68
  • 83