MFSort Memory Tuning: SORTSPACE First, SORTTEMPSPACE Only for COBRT105
Rocket Enterprise Developer 12.0 on UNIX separates contiguous sort workspace from chunked temporary allocation: increase SORTSPACE for ordinary performance, but use SORTTEMPSPACE with a smaller SORTSPACE only when contiguous allocation triggers COBRT105; TMPDIR independently controls paging-file placement. [1] [2] [3] [4]
Read the full briefing
MFSort Memory Tuning: SORTSPACE First, SORTTEMPSPACE Only for COBRT105
Scope: Rocket Enterprise Developer 12.0 for Eclipse on UNIX, COBOL SORT/MFSort runtime behavior. All details below come from bundle enterprisedevelopereclux_ug_120.
Rocket’s central performance rule is straightforward: a SORT is more efficient when more file I/O can be processed in memory. The product exposes several environment variables for that purpose, but the documentation also warns that inefficient input and output procedures can make a sort appear slow. It recommends experimenting with the settings rather than assuming one value fits every workload. See Optimizing File Sorting.
The primary control is SORTSPACE, which allocates the internal workspace for a SORT. Increasing it typically improves overall sort performance. The documented default is only 1 MB; the accepted range is 64 KB through 4 GB minus one byte. Values can be written with unit suffixes or as bytes:
SORTSPACE=64M
SORTSPACE=2G
SORTSPACE=1000000SORTSPACE adds an important boundary: this workspace must be allocated as memory, and setting it too aggressively can produce COBRT105 Memory allocation error (Fatal). When that happens, the documented response is not to keep raising SORTSPACE; reduce it and add SORTTEMPSPACE.
SORTTEMPSPACE changes the allocation pattern. If the runtime cannot obtain enough contiguous memory through SORTSPACE, it allocates memory in chunks whose size is the SORTSPACE value until the total reaches SORTTEMPSPACE. Rocket recommends this option only when COBRT105 is occurring. Its minimum is 32 MB, counting the combined SORTSPACE and SORTTEMPSPACE settings, and its maximum is again 4 GB minus one byte. The manual’s syntax example is:
SORTTEMPSPACE=64MThat distinction makes the operational sequence clear: tune SORTSPACE for normal performance; if contiguous allocation fails, lower the chunk size represented by SORTSPACE and set the required total with SORTTEMPSPACE. The full limitation and ranges are documented on SORTTEMPSPACE.
Memory sizing is separate from disk placement. If the sort creates paging files, UNIX uses the current directory by default. Set TMPDIR to select another directory, for example TMPDIR=/home/temp; Windows uses TMP, or TEMP when TMP is unset. This platform-specific behavior is documented under TMPDIR/ TMP/ TEMP.
Takeaway: Raise SORTSPACE for ordinary in-memory efficiency, but treat SORTTEMPSPACE as the documented COBRT105 recovery mechanism—smaller contiguous chunks toward a larger total—and configure TMPDIR independently when paging-file location matters.