maxmem
| Option Type |
Default Value |
#pragma options |
C |
C++ |
| -qoption |
maxmem=2048
maxmem=8192 |
- |
x |
x |
Syntax
-qmaxmem=size
Purpose
Limits the amount of memory used for local tables of specific, memory-intensive
optimizations to size kilobytes. If that memory is insufficient for a particular
optimization, the scope of the optimization is reduced.
Notes
- A size value of -1 permits each optimization to take as much memory as it needs
without checking for limits. Depending on the source file being compiled, the size of
subprograms in the source, the machine configuration, and the workload on the system, this
might exceed available system resources.
- The limit set by maxmem is the amount of memory for specific
optimizations, and not for the compiler as a whole. Tables required during the entire
compilation process are not affected by or included in this limit.
- Setting a large limit has no negative effect on the compilation of source files when the
compiler needs less memory.
- Limiting the scope of optimization does not necessarily mean that the resulting program
will be slower, only that the compiler may finish before finding all opportunities to
increase performance.
- Increasing the limit does not necessarily mean that the resulting program will be
faster, only that the compiler is better able to find opportunities to increase
performance if they exist.
Depending on the source file being compiled, the size of the subprograms in the source,
the machine configuration, and the workload on the system, setting the limit too high
might lead to page-space exhaustion. In particular, specifying -qmaxmem=-1
allows the compiler to try and use an infinite amount of storage, which in the worst case
can exhaust the resources of even the most well-equipped machine.
Example
To compile myprogram.c so that the memory specified for local table is 16384
kilobytes, enter:
xlC myprogram.c -qmaxmem=16384

List of Batch Compiler Options and Their Defaults
Options that Define the Compiler Object Code Produced
Equivalent Batch Compile-Link and Incremental
Build Options