(Originally posted 2014-04-30.)
I’ve been meaning to write about MEMLIMIT and its importance for some time.
But it’s a moving target. So either there’s no good time to talk about it or lots of good times. 🙂 So let me discuss it now and then again later as necessary.
So timing a post on MEMLIMIT is like choosing a wave to catch: In this case the wave was a discussion in IBM-MAIN about where to find out the MEMLIMIT for an address space, plus the way the MEMLIMIT value came to be set for that address space. Or maybe it’s the announcement of MQ Version 8, which does move the folklore on a bit.
So let me start by describing what MEMLIMIT is and why it’s important. Then I’ll talk about a few examples. Finally I’ll talk about instrumentation.
Why Is MEMLIMIT Important?
Nobody cares how much virtual storage you use, so long as you don’t cause real world effects.
Real world effects include overuse of real memory – as it’s not free – and overcommiting real memory and, still worse, paging space.
MEMLIMIT is the mechanism for limiting an address space’s use of virtual storage. It can be set on the JCL EXEC statement, via an IEFUSI installation exit or in SYS1.PARMLIB(SMFPRMxx).
One way or another you have to set MEMLIMIT for each address space:
Set it too low and the address space might refuse to start. Here I’m thinking of specific products.
Set it too high (or to Unlimited) and you create an exposure: Someone could create a vast 64-Bit Memory Object and touch every page, potentially causing the system to die.
A good but old document on MEMLIMIT is Limiting Storage usage above the bar in z/Architecture by Riaz Ahmad.
Some Key Products
Let’s talk about CICS, DB2 and MQ.
In a typical CICS environment there are numerous CICS address spaces. In CICS 4.2 the minimum value of MEMLIMIT is 4GB, else the CICS region won’t start. In CICS 5.1 the minimum is 6GB.
In reality CICS will use what it needs to. But a region might in fact need more virtual storage, so do keep track of its usage: SMF 30 can help.
There are generally few DB2 subsystems. The only really big address space is the DBM1 address space. Nowadays the MEMLIMIT is set in the JCL as 4 Terabytes. Don’t change it: DB2 can be trusted not to use a threatening amount of real memory, so long as you do due diligence on real memory.
Again there are relatively few MQ subsystems but usually the big address space is MSTR. In Version 7 the default MEMLIMIT was set at 2GB in the JCL.
In Version 8 things can potentially change, and you might need to increase the MEMLIMIT value: While buffer pools are by default still 31 Bit you can choose to make them 64 Bit (and you can long-term page fix them). If you make them 64 Bit you will need to review MEMLIMIT:
I’d suggest adding the sizes of the 64 Bit buffer pools plus 10%  to 2GB and setting that as your new MEMLIMIT.
Actually the CHIN address space can be pretty big, particularly if you have a large number of external connections. But it remains 31 Bit.
As you might expect , SMF 30 (all subtypes) has the eventual MEMLIMIT value (in MB) for the job step. It also has the method by which the MEMLIMIT value was established.
I report on both of these at the address space level. And looking at this data gives me a much better idea how installations manage MEMLIMIT in general. If I talk to you about your MEMLIMIT approach it’ll be from this data and I might well refer you to this blog post. And I’m certainly talking about this in the 2014 revision of “Life And Times Of An Address Space”.
In fact it is in the latest version of my “Life And Times Of An Address Space” presentation (see Recent Conference Presentations.) ↩
It’ll become necessary to when, for example, a product raises the minimum MEMLIMIT value necessary for its address spaces to start. ↩
Not entirely true as presumably the work you’re running matters to somebody, but rhetorically close enough. ↩
The default is the SMFPRMxx value. ↩
Am I foolhardy in mentioning this? I would say I wasn’t as most installations have sensible limits in place to prevent this scenario. Please check yours and fix it if need be – and then my purpose in mentioning it will’ve been served. ↩
This is rapidly becoming understood by z/OS and DB2 Performance people. Perhaps I should write a separate post on this some time. ↩
My thanks to Matthew Leming of MQ on z/OS Development for the information herein. ↩
In fact there was a small amount of 64 Bit exploitation but 2GB is generally sufficient. ↩
The additional 10% is for the buffer pool control blocks, which are above the bar whether the buffer pools themselves are or aren't. ↩