Active2 years, 10 months ago
The theoretical memory limits in 16, 32 and 64 bit machines are as follows:
Dec 14, 2018 - For some time now, computer processors have supported 64-bit. The different 64-bit versions and their maximum memory are as follows. Clearing up the 32/64-bit memory limit confusion. Today Dwight Silverman ran a great piece on TechBlog which examines whether folks buying a new PC are best sticking with 32-bit Vista or making.
- 16 bit = 65, 536 bytes (64 Kilobytes)
- 32 bit = 4, 294, 967, 295 bytes (4 Gigabytes)
- 64 bit = 18, 446, 744, 073, 709, 551, 616 (16 Exabytes)
I remember from DOS / Windows 3.11 days, that 16 bit memory could be separated into segments, so that a 16 bit machine could access a greater amount of memory than 64 Kilobytes.
I have a machine with 16GB of memory, and am dual booting a 32bit operating system and a 64bit operating system. I can access all 16GB from 64bit, but only 3.21GB in 32bit.
So, my question is, if 16bit operating systems allowed greater that 64KB memory access due to memory segmenting, why do 32bit machines not follow the same pricipal?
series0neseries0ne35133 gold badges77 silver badges2020 bronze badges
5 Answers
They do, the system is called Physical Address Extension (PAE). Here is a list of windows OS'es and their max memory, any 32 bit system that allows for more than 4GB of RAM is using PAE to access the memory (For example Windows 2003 R2 Datacenter 32 bit allows for 128GB of ram).
In fact Windows 8 requires a PAE capable CPU in it's minimum requirements.
To address your 'unasked' question on why your 32 bit OS can't access the ram if it exists: Licensing. They choose not to allow RAM to be above 4GB for their 32 bit OSes unless you pay for a>66 gold badges8484 silver badges102102 bronze badges
Instead of explaining it myself, I'll let someone who has to maintain a kernel with PAE support speak in his charming ways, Linus Torvalds
Also keep in mind that the PAE support in Windows 32bit versions comes for a lot of cash. XP won't even be able to make use of full 4 GiB of RAM normally, because MS chose to not enable PAE features on it. A kernel that is closely related, Windows 2003 Server, does support PAE. However, even there your 'Standard edition' will only support up to 4 GiB (but working around the BIOS memory hole), whereas the more expensive editions will then allow up to 64 GiB of RAM. The same holds for 32-bit Vista.
However, not in all cases is this limitation imposed by Windows. If it were, booting a PAE-enabled Linux kernel would still enable you to use the full 4 GiB (or more). Not so, some hardware manufacturers chose to impose this limitation at the BIOS level, although the CPU and chipset would be capable of handling PAE.
Just a side-note: none of the current x86-based 64bit processors can even address the full range of the 64bit address space physically (for reference see this question and answers).
Community♦
0xC0000022L0xC0000022L3,61666 gold badges3838 silver badges7070 bronze badges
Because there is no practical reason to do so. Physical Address Extensions allow much the same functionality and their use is still very limited amongst users. In the Windows 3.1 days there were constraints that just aren't present today.
OCDtechOCDtech
8-bit CPUs usually had a 16-bit address bus. (Motorola had a unified address bus, RAM and peripheral I/O shared the same address space, Intel chose to divide the two. In the case of Intel, the IO address limits of the 8088 and 8086 carried the limits over from the 8080 & 8085 CPUs.)
Intel's 8088 and 8086 had a 20-bit memory address bus(1MB), while Motorola's 68000 had a 24-bit address bus (16 MB). IIRC, the [80]286 jumped to a 24-bit address bus. Both later expanded to a 32-bit address bus with the [80]386 and the 68020 respectively.) With the Pentium chips, the address bus expanded to 64-bits. (I think the Motorola/IBM venture PowerPC chips also went 64-bit address bus.)
Memory available below and up to the maximum that could directly be accessed by the CPU was only limited by the supporting hardware chips (chipset) and OS. Bill Gates was famous in the past for stating that nobody needed more than 640K of RAM, thus DOS never evolved to directly access more RAM. With HiMem.sys and EMM386, DOS was extended to access more 'upper' memory, with EMM386 being used to directly access all available RAM. HiMem.sys had less flexibility and could basically use the extra RAM for storage.
Memory exceeding that limit required a MMU (Memory Management Unit) to break the memory into segments and map it into the addressable memory space of the CPU. It's how the CoCo 3, Commodore 128, and other 8-bit computers could access more than 64K of RAM.
More favorable now is to use virtual memory to extend past physical memory limits, albeit with the limits imposed by the OS.
WilliamWilliam
The theoretical memory limits in 16, 32 and 64 bit machines are as follows ...
The fundamental flaw here is the notion that the 'bit width' of the processor, which is usually the size of the machine's general-purpose registers, is necessarily the same as the width of RAM addresses.
In x86 with paging enabled, but without PAE, the addresses that program and OS code use are called 'linear addresses' by Intel - we usually call them 'virtual addresses'. They're 32 bits wide. This permits a 4 GiB virtual address space.
But it is more or less coincidence, merely an artifact of the format of page table entries that the size of a physical (RAM) address is also 32 bits.
With PAE the latter is 36 bits (at first... wider in later implementations). So, just because it is, for example, a '32 bit machine' does not mean that physical memory addresses are limited to 32 bits.
The industry has a long history of machines whose 'bit width' did not match their maximum physical address size. For example, the VAX architecture defines a 32-bit machine, and virtual addresses (which are the addresses used by code once address translation is turned on) are indeed 32 bits wide... but the VAX's physical addresses are only 30 bits wide - and half of the physical address space is devoted to I/O device registers, so maximum RAM was only 512 MiB.
Even without address translation hardware, it is not necessarily the case that the machine's 'bit width' defines the maximum RAM address. Example: The CDC 'upper 3000' series were 36-bit machines. Do you think they could address 64 GiB of RAM? Not hardly! Those machines came out in the mid-60s! Heck, we couldn't even have 64 GB of disk space in those days. (The CDC 6000 series were 60-bit machines. Need I go on?)
![64 bit memory limit windows 64 bit memory limit windows](/uploads/1/2/5/7/125737781/733485666.jpg)
19.3k33 gold badges4545 silver badges8181 bronze badges
Not the answer you're looking for? Browse other questions tagged memory64-bitoperating-systems32-bit16-bit or ask your own question.
Active4 years, 10 months ago
I currently have a 32-bit .Net application (on x86 Windows) which require lots of memory. Recently it started throwing System.OutOfMemoryException's.
So, I am planning to move it to a x64 platform as 64-bit process. So will this help with the out of memory exceptions. I was reading this article from MSDNMemory limits for Windows
So, my question is if I compile a 64bit .Net application, will it have IMAGE_FILE_LARGE_ADDRESS_AWARE set as default (As the article suggests)? i.e will I be able to take advantage of the 8GB user-mode virtual address space?
SysAdminSysAdmin3,16566 gold badges2626 silver badges3232 bronze badges
5 Answers
The maximum memory limit for x64 processes is 8 TB, but the practical limit is far less as it depend on the amount of physical memory and the pagefile size on your system. See this post for more details on this.
The IMAGE_FILE_LARGE_ADDRESS_AWARE affect an x86 process running on a x64 OS (or a x86 OS with the /3GB directive). Your x64 application does not need to set the large address aware flag and it will be able to use all the available virtual memory on your system.
Community♦
Jeff CyrJeff Cyr3,80611 gold badge2323 silver badges4040 bronze badges
IMAGE_FILE_LARGE_ADDRESS_AWARE
is only relevant for 32 bit processes. The reason is that the address space on 32 bit Windows is split in two: 2 GB for kernel space and 2 GB for user space. To address 2 GB you need 31 bits. I.e. the pointers in a 32 bit application do not need the last bit for addressing. Some applications may have used this extra bit for custom purposes, so if the Windows memory manager suddenly hands them a real 32 bit address they can't handle that. By enabling the
IMAGE_FILE_LARGE_ADDRESS_AWARE
flag the application basically tells the OS that it can handle the entire 32 bit addressable space. If you run a
IMAGE_FILE_LARGE_ADDRESS_AWARE
application on 32 bit Windows you can access 3 GB. If you run the same 32 bit application on 64 bit Windows the process actually gets the entire 4 GB address space. If you run a 64 bit application on 64 bit Windows the user address space is 8 TB (with another 8 TB set aside for kernel address space). .NET applications set to AnyCPU will automatically be 64 bit applications on x64, so you don't have to do anything to address the additional memory.
Keep in mind, however, that the CLR imposes a 2 GB limit on any single object, so while your application may use a lot of memory, you cannot create a 2 TB array for instance. More info in this question: Single objects still limited to 2 GB in size in CLR 4.0?
Community♦
Brian RasmussenBrian Rasmussen101k3232 gold badges198198 silver badges296296 bronze badges
Actually, that article states you will have access to 8 TB of virtual address space (and yes, this is true).
Andrew HareAndrew Hare290k5555 gold badges597597 silver badges609609 bronze badges
Actually on an x64 OS if your application is compiled for AnyCPU then you don't need to do anything special. The JIT will create an x64 image at runtime or an x86 image when run on a 32 bit system.
JoshJosh59.8k1414 gold badges125125 silver badges149149 bronze badges
Moving to a 64 bit definitely helps cut out the OutOfMemoryExceptions, but you might want to focus on your system architecture and coding mechanisms to avoid these as it would only be a matter of time before they surface on the 64 bit machine as well.
One more advantage of moving to 64 bit machines is that with an 8 TB of virtual address space, Garbage collection for .NET happens infrequently. This does improve application performance by increasing the available virtual space for your program.
One more advantage of moving to 64 bit machines is that with an 8 TB of virtual address space, Garbage collection for .NET happens infrequently. This does improve application performance by increasing the available virtual space for your program.
Bharath KBharath K