MEMLIMIT Parameter

Purpose

The MEMLIMIT parameter specifies the maximum amount of virtual storage above the 2GB bar that a job can use. This parameter is crucial for 64-bit applications that need to address memory beyond the traditional 2GB limit of 31-bit addressing. MEMLIMIT controls the allocation of 64-bit addressable virtual storage, allowing applications to work with large in-memory datasets, caches, or other memory-intensive operations.

Syntax

JOB Statement Format

jcl
1
//jobname JOB parameters,MEMLIMIT=value

EXEC Statement Format

jcl
1
//stepname EXEC PGM=program,MEMLIMIT=value

Parameter Values

value

ValueDescription
nnnnnMSpecifies the limit in megabytes (1048576 bytes)
nnnnnGSpecifies the limit in gigabytes (1073741824 bytes)
nnnnnTSpecifies the limit in terabytes (1099511627776 bytes)
nnnnnPSpecifies the limit in petabytes (1125899906842624 bytes)
0No 64-bit virtual storage can be used
NOLIMITNo limit on 64-bit virtual storage usage

Note:

If you omit the MEMLIMIT parameter, the system uses the default value specified in the SMFPRMxx member of SYS1.PARMLIB, or the MEMLIMIT value in the user's RACF profile. Typically, this default is either 2G or NOLIMIT, but it varies by installation.

Usage Examples

Basic JOB Level Specification

jcl
1
2
//TESTJOB JOB (ACCT),'JOHN DOE',CLASS=A, // MSGCLASS=X,MEMLIMIT=4G

This job can use up to 4 gigabytes of virtual storage above the 2GB bar.

Step Level Specification

jcl
1
//STEP1 EXEC PGM=BIGMEM,MEMLIMIT=16G

This step can use up to 16 gigabytes of virtual storage above the 2GB bar.

Unlimited Memory Usage

jcl
1
2
//TESTJOB JOB (ACCT),'JOHN DOE',CLASS=A, // MSGCLASS=X,MEMLIMIT=NOLIMIT

This job has no limit on the amount of 64-bit virtual storage it can use.

No 64-bit Memory Usage

jcl
1
2
//TESTJOB JOB (ACCT),'JOHN DOE',CLASS=A, // MSGCLASS=X,MEMLIMIT=0

This job cannot use any 64-bit virtual storage.

Virtual Storage Concepts

z/OS Memory Architecture

Understanding the MEMLIMIT parameter requires knowledge of z/OS memory architecture:

User Private Area (Below the Line)
0 - 16MB
Extended User Private Area
16MB - 2GB
64-bit Common Area
2GB - 2TB+ (MEMLIMIT applies here)
Simplified z/OS memory architecture showing where MEMLIMIT applies

How 64-bit Memory Is Used

64-bit addressable memory is allocated through specific interfaces:

  • IARV64 service: System service that programs use to request 64-bit memory
  • Language constructs: Programming languages like C/C++ or Java provide constructs to allocate large memory objects
  • Memory objects: Contiguous virtual storage areas in 64-bit address space
  • MEMLIMIT: Controls the maximum size of all memory objects a single address space can allocate

Parameter Hierarchy

When determining the actual MEMLIMIT for a job step, the system uses the following hierarchy (highest priority first):

  1. MEMLIMIT specified on the EXEC statement for the step
  2. MEMLIMIT specified on the JOB statement
  3. MEMLIMIT specified in the JES exit (installation-specific)
  4. MEMLIMIT specified in the RACF user profile (if SMF is active)
  5. MEMLIMIT specified in the SMFPRMxx member of SYS1.PARMLIB
  6. System default (usually 2G)

Practical Applications

Types of Applications That Need Large MEMLIMIT

  • Database Management Systems: DB2, Oracle, and other database systems use 64-bit addressability for buffer pools and caches
  • Analytics Applications: Data mining, statistical analysis, and business intelligence applications that process large datasets
  • Java Applications: Enterprise Java applications with large heap sizes
  • In-Memory Computing: Applications that maintain large data structures in memory for performance
  • Scientific Computing: Weather modeling, genomics, and other scientific applications that work with large datasets

Determining Appropriate MEMLIMIT Values

Consider these factors when setting MEMLIMIT:

  1. Application documentation and requirements
  2. Size of datasets being processed
  3. Available real and auxiliary storage in the system
  4. Other workloads running concurrently in the system
  5. Performance requirements and response time objectives

Monitoring and Troubleshooting

Monitoring 64-bit Memory Usage

Several tools and commands can help monitor 64-bit memory usage:

  • DISPLAY M command: Shows system-wide memory usage
  • RMF (Resource Management Facility): Provides detailed reports on memory utilization
  • SMF Type 30 records: Contain memory usage statistics for each job step
  • SDSF (System Display and Search Facility): Shows job memory usage in the job summary panel

Common Issues

IssuePossible Solution
Job fails with S878 abendIncrease MEMLIMIT value or optimize application memory usage
Poor system performance due to excessive pagingReduce MEMLIMIT to constrain memory usage or increase real/auxiliary storage
64-bit application cannot allocate memory despite sufficient MEMLIMITCheck system-wide memory constraints or auxiliary storage limitations
MEMLIMIT parameter appears to have no effectVerify that the application is actually using 64-bit addressing

Common Error Messages

  • IEF233A M TESTJOB,STEP1 - WAITING FOR REAL STORAGE - System is waiting for real storage to back virtual storage pages
  • IEF374I STEP/STEP1 - JOB/TESTJOB ENDED BY S878 ABEND - Job exceeded MEMLIMIT and was terminated

System Management Considerations

Impact on System Resources

Setting MEMLIMIT values has broader system implications:

  • Real storage utilization: 64-bit virtual memory requires real storage backing
  • Auxiliary storage: Paging space needed for virtual memory
  • System responsiveness: Excessive memory usage can cause increased paging and reduced performance
  • Other workloads: Large memory consumers can impact other jobs in the system

Setting System-Wide Defaults

System administrators can control default MEMLIMIT settings through:

  • SMFPRMxx parmlib member: MEMLIMIT parameter sets the system-wide default
  • RACF user profiles: Set default MEMLIMIT values for specific users
  • JES exit routines: Dynamically adjust MEMLIMIT based on job attributes
  • Workload management policies: Assign different resource limits based on workload importance

Best Practices

  1. Set appropriate MEMLIMIT values based on application requirements and system capacity
  2. Use step-level MEMLIMIT rather than job-level to provide more granular control
  3. Avoid using MEMLIMIT=NOLIMIT except for well-understood applications
  4. Monitor memory usage patterns to refine MEMLIMIT settings over time
  5. Establish guidelines for different application types and their MEMLIMIT requirements
  6. Consider time-of-day variations in memory requirements and system load
  7. Document MEMLIMIT requirements for critical applications

Related Concepts

  • JOB Statement - Where the MEMLIMIT parameter can be specified at the job level
  • EXEC Statement - Where the MEMLIMIT parameter can be specified at the step level
  • REGION Parameter - Controls virtual storage below the 2GB bar