Kbase P11351: What is the -mmax parameter?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  28/01/2011 |
|
Status: Verified
GOAL:
What is the -mmax parameter?
GOAL:
-mmax: When will we exceed it and when do we use sort files?
GOAL:
What happens if the -mmax parameter is set too low?
GOAL:
WARNING: -mmax exceeded. Automatically increasing from to (5409)
FACT(s) (Environment):
Progress 9.x
OpenEdge 10.x
All Supported Operating Systems
FIX:
The Maximum Memory (-mmax) client session parameter specifies the maximum amount of memory allocated for r-code segments, in kilobytes.
It is a soft limit, meaning that it will be exceeded if no alternative action is available.
Progress dynamically allocates space for r-code segments in the execution buffer as needed. When memory allocation reaches the value specified by the -mmax value, Progress will start swapping out non-active segments to make room for new active procedures. If all r-code segments in memory are considered active and none can be swapped out, Progress will increase the -mmax value and then display the warning message "WARNING: -mmax exceeded. Automatically increasing from <old value> to <new value>. (5409)"
Note that the following segments are considered active: segments that are on the "call stack", which are persistent and text segments associated with other active segments. The remaining r-code segments are considered to be available to be swapped out if necessary.
Prior to OpenEdge 10.2B, the r-code segments that are least recently loaded will be the first to be swapped out when needed. From OpenEdge 10.2B onward, the r-code segments that are least recently used will be the first to be swapped out when needed. This change in the swapping logic leads to significantly fewer swap operations being performed in most situations, thus providing overall performance improvement.
If a procedure is run to completion and is not persistent, Progress will not redeem the memory for the r-code until it is needed. Many times the same procedures are run over and over again, so keeping them in memory as non-active improves performance by avoiding reloading.
When will a low -mmax cause issues ?
1. When the warning messages appear on a regular basis this may indicate two things:
- If the value stabilizes, there is no immediate issue; just an indication that the application requires more resources than the current settings provide. In this case, increase the -mmax startup parameter to change the initial value in order to meet the application's requirements.
- If the limit keeps increasing without stabilizing at some point, this indicates an issue in the application code. The number of active segments keeps increasing, which indicates a resource leak somewhere.
2. A too low -mmax setting may cause an I/O bottleneck on the client's temp-files even if no warnings are raised. This in turn can lead to performance issues.
This is seen when using large procedures or deeply nested procedure calls; the reason for this is that larger segments and/or a larger number of segments may fill up the memory quickly, but the segments will go non-active. Non-active segments will be swapped out before the soft-limit on -mmax is being raised, so this results in r-code swapping relatively soon without warnings. In this case increasing the -mmax normally helps to reduce disk I/O activity required to swap segments.
How the segment swapping is handled depends on the configuration.
1. If the rcode is stored as separate .r files, swapping will always go to a client temp-file (srt* in releases before 10.1C, rcd* in 10.1C and later).
2. If the rcode is stored in a procedure library and the PROLIB Swap (-pls) startup parameter is not specified, swapping will not go to the client temp-file. Instead, the segments will be re-loaded from the procedure library as needed. This typically improves performance as the procedure library will remain open and will give the same read performance, while write operations are eliminated.
3. If the rcode is stored in a procedure library and the PROLIB Swap (-pls) startup parameter is specified, swapp.ing will take place to the client temp-file. This is recommended if the library is stored on a remote file system, and the network overhead on re-reading the segments has a bigger performance impact than the swapping disk I/O.
4. Starting from OpenEdge 10.2B, if a memory-mapped procedure library has a different codepage than the session's codepage, the r-code text segments will be codepage-converted and after the conversion they will always be swapped to the rcd* temp-file as if the -pls parameter was specified. The other r-code segments will behave as per points 2 and 3 above. (Note that in releases prior to 10.2B, a memory-mapped procedure library can not be used in a session at all if the codepages don't match.)
Related startup parameters
1. Use Statistics (-y) and Segment Statistics (-yd) startup parameters to see segment allocation and swapping information. The statistics provided are often useful to identify when a low -mmax causes a lot of swapping activity without raising warnings.
2. Use the -noincrwarn startup parameter to suppress the warning messages when the limit is exceeded. This is not recommended in development, test or pre-production environments as they do indicate these settings may need further tuning.
3. Use the -hardlimit startup parameter to prevent the -mmax value from being exceeded. When doing so, the process will terminate using an untrappable STOP condition when the limit is hit. This only recommended for diagnostic purposes and environments where resources are limited..