- Static data. The restriction is imposed on the size of the program source code itself and the size of statically allocated memory. In C++, such data are usually represented by global variables defined outside procedures. The restriction concerning the size of statically allocated memory is 2 Gbytes both for 32-bit and 64-bit programs.
- Dynamic data. These are data for which memory is being allocated while executing the program. In C++, this allocation is usually performed by the malloc function or new operator. In 32-bit programs the size of dynamically allocated memory is restricted by 2 Gbytes, in 64-bit programs by 8 Tbytes.
- Stack data. Memory is allocated for these data when entering a procedure and is released after exiting the procedure. The maximum size of program stack is 1 Gbyte both for 32-bit and 64-bit applications. (The stack size is defined by the linker and is 1 Mbyte by default)
Note that the restrictions for maximum sizes of statically allocated memory and stack memory are the same for 32-bit and 64-bit Windows-applications. This is determined by the format of file type Portable Executable (PE) which is used in Windows to describe exe and dll files. You should keep in mind that these restrictions are imposed by the operating system itself and do not depend on the compiler you are using.
References
- Steve Lionel. Memory Limits for Applications on Windows
- Andrey Karpov, Evgeniy Ryzhkov. Lesson 2. Support of 32-bit applications in the 64-bit Windows environment
Комментариев нет:
Отправить комментарий