Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

CICS Pgm excessive Memory (EDSA HWM) used issue

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
Hemant_kumar_1

New User


Joined: 18 Jun 2009
Posts: 5
Location: Pune

PostPosted: Fri Feb 10, 2012 6:33 pm    Post subject: CICS Pgm excessive Memory (EDSA HWM) used issue
Reply with quote

Hi,

I am facing an issue where my program is showing high amount of memory usage and so gets abend RLED. I got from support team that usage is ~ 42MB.

My program is being linked from other pgm and till now chain is like this -
ext pgm1-->(link) my pgm1 -->(link) my pgm2-->(link) ext pgm2

ext pgm2 is a routine to convert data from ebcdic to UTF8. For this purpose "my pgm2" does a getmain so that it's address could be passed all the way back to ext pgm1 as output.

With hit and trial I found that if I comment getmain logic and use a working storage for part -
my pgm2-->(link)ext pgm2

then memory usage is ~ 4MB. But when using GETMAIN suddenly memory usage is >40MA. I am doing GETMAIN of 3000 byte only, so not sure why it could be causing this. I tried tracking it in debug but when used with that, abend RLED doesn't appear. May be because debug is given more memory by default or something else. no idea about that.

Could anyone help me how I can drill down further to cause of issue or any possible solution?

Thanks,
Hemant
Back to top
View user's profile Send private message

Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Feb 10, 2012 6:43 pm    Post subject:
Reply with quote

At what point does the memory acquired by GETMAIN in "my pgm2" get FREEMAINed? Are you GETMAINing multiple times without issuing FREEMAIN?

Garry.
Back to top
View user's profile Send private message
Hemant_kumar_1

New User


Joined: 18 Jun 2009
Posts: 5
Location: Pune

PostPosted: Fri Feb 10, 2012 6:51 pm    Post subject: Reply to: CICS Pgm excessive Memory (EDSA HWM) used issue
Reply with quote

Hi Gary,

It is a single GETMAIN of 3000 length. FREEMAIN for this is done by ext pgm1 befor ending who gets this address. We pass a flag to do this freemain by ext pgm1.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Feb 10, 2012 6:56 pm    Post subject: Reply to: CICS Pgm excessive Memory (EDSA HWM) used issue
Reply with quote

The GETMAIN in PGM2 is unnecessary as it should be substituted by WS. When PGM2 is accessed, an internal CICS GETMAIN is issued for the entire WS area, including your 3000-Byte area, when you've defined it to WS. When PGM2 returns to PGM1, an internal FREEMAIN is issued to free the previously allocated WS at the "Enclave" level.

Without defining the 3000-Byte area to WS, the explicit GETMAIN is issued every time PGM2 is accessed, until task termination, not at enclave termination.

Are you issuing a FREEMAIN in PGM2 before returning to PGM1?

If not, then this is why you're accumulating this high DSA allocation at the task level.

Use the WS approach and you'll be fine....

Mr. Bill
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Feb 10, 2012 7:15 pm    Post subject: Reply to: CICS Pgm excessive Memory (EDSA HWM) used issue
Reply with quote

After re-reading your requirement, defining the 3000-Byte area to WS in PGM2 won't work. icon_redface.gif

You could then either issue an explicit GETMAIN in PGM1 and pass this address in the commarea to PGM2 or (if you're COBOL version/release is 390/COBOL 2.2.1 or higher), you can SET a POINTER to your 3000-Byte area in WS and pass this address to PGM2 in the commarea, same concept as the GETMAIN usage.

This also could be a good reason to use EXTERNAL STORAGE which was introduced with COBOL II V4.

Mr. Bill
Back to top
View user's profile Send private message
Hemant_kumar_1

New User


Joined: 18 Jun 2009
Posts: 5
Location: Pune

PostPosted: Fri Feb 10, 2012 7:20 pm    Post subject: Reply to: CICS Pgm excessive Memory (EDSA HWM) used issue
Reply with quote

Thanks for suggestion Bill.

When you are saying FREEMAIN would be at "Enclave" level, won't all WS memory will be dropped once control is back in "my pgm1".

I need to preserve this 3000 bytes till cotrol goes back to ext pgm1 (first in series) that's why I am using GETMAIN. There are no multiple calls so GETMAIN in "my pgm2" is executed only once. Should not it keep only 3000 bytes?

Or you are suggesting that it might keep all it has got till then and that could be causing this issue?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Feb 10, 2012 7:24 pm    Post subject: Reply to: CICS Pgm excessive Memory (EDSA HWM) used issue
Reply with quote

Maybe there's some sort of loop-error in PGM2, where multiple GETMAIN's are being issued?

Walk the transaction through CEDF and verify the number of GETMAIN's being issued.

Are there any CALLED (not LINKED) sub-programs in the mix that have big WS allocations?

CALLED sub-program WS is not implicitly FREED until "Enclave" or "Task" termination, unless a particular LE option is used (name escapes me).

Mr. Bill
Back to top
View user's profile Send private message
Hemant_kumar_1

New User


Joined: 18 Jun 2009
Posts: 5
Location: Pune

PostPosted: Sat Feb 11, 2012 10:34 am    Post subject: Reply to: CICS Pgm excessive Memory (EDSA HWM) used issue
Reply with quote

I tried doing GETMAIN in "my pgm1", but it has same effect. Still memory usage is > 40MB.

What puzzles me that how that specific GETMAIN instruction is affecting so much irrespective of where I place it.

I have access to OMEGAMON, but not able to research it much as I am not able to understand trace information from it. It shows about 7-8 GETMAIN (from ext pgm1) but a lot more FREEMAIN. When combining those GETMAIN length, it is still less than 2-3 MB.

Any other way I can get a TRACE of what all memory being taken by this flow?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Feb 11, 2012 10:53 am    Post subject: Reply to: CICS Pgm excessive Memory (EDSA HWM) used issue
Reply with quote

In your GETMAIN API, are you using the FLENGTH keyword but specifying a PIC 9(04) COMP (Halfword) field with a value of 3000 instead of PIC 9(08) or PIC 9(09) COMP (Fullword) field with a value of 3000?

The API doesn't care, because during expansion, it uses the starting address of the COMP field, for a length of four contiguous bytes (Fullword). So, PIC 9(04) COMP is only two bytes and the API is using the last two bytes as part of the FLENGTH and these last two bytes could contain anything.

Your CICS System Programmer can setup a TRACE using IBM transaction CETR.

Mr. Bill
Back to top
View user's profile Send private message
Hemant_kumar_1

New User


Joined: 18 Jun 2009
Posts: 5
Location: Pune

PostPosted: Mon Feb 13, 2012 12:06 pm    Post subject: Reply to: CICS Pgm excessive Memory (EDSA HWM) used issue
Reply with quote

Thanks a ton Bill.

Seems this was the problem.. i was using FLENGTH field but it was defined as S9(05) COMP-3.

I correct it to be S9(09) COMP and seems all problem has gone. I am still keeping my fingers crossed and monitor transaction for today but it would be very silly of me to do such error.

Thanks again for pointing it out as not sure how long I would have struggled to find it. I will share udate if this issue will not occur to confirm exact cause.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Feb 13, 2012 4:54 pm    Post subject: Reply to: CICS Pgm excessive Memory (EDSA HWM) used issue
Reply with quote

Sometimes the obvious isn't always that obvious. icon_wink.gif

I can't think of any CICS API's that use other than Halfword's and Fullword's for LENGTH/FLENGTH.

Glad you were able to rectify this....

Mr. Bill
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
No new posts DFHRESPONSE returns issue divated CICS 3 Wed Nov 02, 2016 6:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us