Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does DROP Release Storage?

Status
Not open for further replies.

TuffSubject

Programmer
Sep 16, 2006
1
US
To avoid S878 abends, I'm working with a REXX application to verify that the amount of available storage to a TSO user is over a (a program-designated threshold) before it continues. The idea is to terminate gracefully vs. incurring an S878 abend

I've successfully obtained the maximum/available storage information using the STORAGE function to pull values in the LDA (chained from the ASCB) to determine the amount of storage available to a user. I tested the logic by running it to get a baseline, then in split screen I edited a VERY LARGE file, then re-ran the process to see the significant increase in amount of storage in use. Then, after cancelling the EDIT session, I re-ran the process and saw that the amount of storage in use had dropped back to the baseline.

But when running REXX programs that consume significant amounts of storage I'm observing unexpected results: After I execute a REXX EXEC, the "used storage" does not decrease. I first assumed that once a REXX EXEC terminated, that the GETMAIN'd storage for variables used in that EXEC would be released once the EXEC terminated. I've even tried using the DROP command for stem variables (hoping this would free the significant storage utilized by them). The amount of "used storage" remains at its high water mark after the REXX EXEC terminates.

Subsequent REXX programs seem to be able to re-use this storage, but the number doesn't drop between executions.

Another observation: When the "top level" program under which the REXX program is executing terminates, the storage seems to be released. For example, if the REXX program runs under ISPF, the storage is released once ISPF has been terminated. But if the REXX program is run again under the TSO READY prompt, the storage accumulates and does not get released until the user logs-off of TSO.

Does anyone have any advice or information to help understand this? Do REXX programs that use stem variables not free the storage when the program terminates? Is the LDA the correct place to determine the amount of available storage?

Any help or advice would be appreciated. Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top