View previous topic :: View next topic
|
Author |
Message |
Suja.Sai
New User
Joined: 26 Sep 2008 Posts: 12 Location: Bangalore
|
|
|
|
Hi,
If we use Getmain to get the memory space of maximum length of the output response array container (say 100) and then populate the output response array container with only 10 records. Will issuing a freemain, freeup all the remaining 89 records of freespace? Or will it just free-up the space acquired by getmain command?
Please clarify.
Thanks,
Suja |
|
Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
What did you understand, or require clarification of, from the documentation? |
|
Back to top |
|
 |
UmeySan
Active Member

Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
@ Suja.Sai
With the GETMAIN instruction you obtain a contiguous block of virtual storage. So you requests a certain amount of storage space.
With the FREEMAIN command you release this storage.
See also STORAGE OPTAIN/RELEASE instructions in the manuals.
STORAGE OBTAIN/RELEASE -> uses PC(Program Call)
GETMAIN/FREEMAIN -> uses SVC
It was said that a PC instruction would be much more efficient than a SVC interruption.
Regards, UmeySan |
|
Back to top |
|
 |
prino
Senior Member

Joined: 07 Feb 2009 Posts: 1318 Location: Vilnius, Lithuania
|
|
|
|
Bill Woodger wrote: |
What did you understand, |
That 89+10 = 100...
Sheesh... |
|
Back to top |
|
 |
dneufarth
Active User

Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
Thank you Robert. I'm still laughing. Made my day get off to a great start. |
|
Back to top |
|
 |
Suja.Sai
New User
Joined: 26 Sep 2008 Posts: 12 Location: Bangalore
|
|
|
|
Sorry, that was a typo.
Thanks a lot Umeysen for the clarification. |
|
Back to top |
|
 |
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
UmeySan wrote: |
STORAGE OBTAIN/RELEASE -> uses PC(Program Call)
GETMAIN/FREEMAIN -> uses SVC
It was said that a PC instruction would be much more efficient than a SVC interruption. |
That's a lie.
As an experiment, I ran a comparable run of GETMAIN/FREEMAIN and repeated it with STORAGE OBTAIN/STORAGE RELEASE. STORAGE OBTAIN/STORAGE RELEASE required substantially more CPU time than GETMAIN/FREEMAIN. |
|
Back to top |
|
 |
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Arguably this is not a suitable discussion in a CICS forum, since one should not use GETMAIN/FREEMAIN in CICS - at least not directly. I will prepare a suitable topic in the PL/I / Assembler forum with a test program to demonstrate my contention. |
|
Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8701 Location: Dubuque, Iowa, USA
|
|
|
|
As a reminder, GETMAIN and FREEMAIN are part of the CICS API and don't really have anything to do with the GETMAIN / FREEMAIN macros.
Did you read the description of EXEC CICS FREEMAIN in the Application Development Reference manual in the CICS bookshelf for your version of CICS? If so, did you miss the statement in the FREEMAIN description (from the 5.3 version):
Quote: |
The length of storage released is the length obtained by the GETMAIN request. |
If you do a FREEMAIN, you'd better be through with that storage because it won't be there any more -- not even the 10 records you put in. |
|
Back to top |
|
 |
UmeySan
Active Member

Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
@ Robert
Your right sir, for CICS i also remenber a GETMAIN64/FREEMAIN64 command for use in non LE. Never used them.
@ Robert
Thats only what i heard an read about it. Fair and square, with theese mips today, i don't give a shit about a second more or less. My two pennies worth.
Regards, UmeySan |
|
Back to top |
|
 |
|