Intel® C++ Compiler - Array size limit on IA-32

The maximum size of an array that can be created by the 32-bit Intel® C++ Compilers for Linux* or Mac OS* is 2 GB.
For the 32-bit Intel® C++ Compiler for Windows* or Intel® Parallel Composer, the maximum array size is 0x1FFFFFFF.

Note: You must have enough memory on the system (both physical memory plus swap space) to create arrays with the requested sizes.

On Linux or Mac OS, typically, shared libraries are loaded at 1 GB, which limits the contiguous address space available to your program. You will get a load time error if your program + static data exceed this.
The possible work-arounds are as follows:

  • build with -static, ie don't load any shared libraries.
  • rebuild your kernel so that the shared libraries get loaded at a different default address.
  • Allocate some of your data differently, on the heap or on the stack, which will put it at a higher address than the shared libraries.
  • Use the prelink command to place the shared libraries that you need at a different (higher) address.
 
For more complete information about compiler optimizations, see our Optimization Notice.
Tags: