IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Memory allocation issue resulting in protecction exception


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Mon Jan 03, 2011 12:08 pm
Reply with quote

Few months back I had faced issue regarding an IMS MPP. The MPP was representing an IMS transaction and in turn MPP was calling numerous programs which were having huge working storages. All of the working storages were adding up to round about 48M of space and the IMS online region limit was set to 6400K (due to some reason). So whenever the memory requirement was exceeding the 6.4M the program use to abend. Please note that all the calls made from MPP were dynamic. So in some of the "memory intensive" logical flows (where most of the modules were called), the program use to abend for rest of the flows the program use to work fine.

Now question here is, in order to satisfy the functionality we had no option but to have huge working storages. But like CICS, cant we allocate the memory space as and when we require, use it and then release it, in IMS or any non-CICS env?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jan 03, 2011 2:19 pm
Reply with quote

you wrote a large (an somewhat incorrect) post about COBOL CANCEL in another thread,
hopefully you now understand CANCEL; why can not that be employed?
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Mon Jan 03, 2011 2:36 pm
Reply with quote

As a matter of fact we did employ it (to an extent). But did not work in this particular case. But there is a dependecy of data from one module to another module. So even if we cancel all the modules those we can still we are well above the region limit. And that is reason why I want to know whether there is way of allocating memory run-time (like CICS GETMAIN)?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Jan 03, 2011 3:30 pm
Reply with quote

why try to allocate memory when you have already exceeded your limit?

and yes, the LanguageEnvioronment has methods for allocating memory,
a 'batch' getmain.

Here is a link to the LE Manuals

Here is a link to the LE Overview
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jan 03, 2011 3:47 pm
Reply with quote

Quote:
Memory allocation issue resulting in protection exception


memory allocation issues will never result in protection exception
the might result in getmain/freemain related abends
( 804,878,704,...., add a few more)

protection exception will spring from misuse of allocated storage!
( or any storage, really )
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Mon Jan 03, 2011 5:46 pm
Reply with quote

The protection exception is not coming while allocating memory. It is coming while accessing it. Once the already allocated memory access exceed the adreess 6.4M (region set limit) then it fails with protection exception.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Jan 03, 2011 5:54 pm
Reply with quote

Quote:
Once the already allocated memory access exceed the adreess 6.4M (region set limit)


please be so kind to explain how You were able to allocate memory/storage beyond the region set limit
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jan 03, 2011 8:55 pm
Reply with quote

Hello,

Quote:
Now question here is, in order to satisfy the functionality we had no option but to have huge working storages.
One option would be to write the data into a "work" database table and re-read it as needed. . .
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Tue Jan 04, 2011 8:59 am
Reply with quote

Hi Enrico,

You are right. As and when the programs were dynamically called the memory was being added. So at the time when it exceeded the 6.4M limit it was failing.

It was resulting in U4038 abend and in fault analyzer it was showing as protection exception.
Back to top
View user's profile Send private message
mlp

New User


Joined: 23 Sep 2005
Posts: 91

PostPosted: Wed Jan 05, 2011 10:27 am
Reply with quote

Hi Dick,

I have found two functions CEEGTST and CEEFRST which can allocate and free (respectively) the heap storage.

We will try to use them and see whether it works or not.

Thanks for the info.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Check data with Exception Table DB2 0
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Abend S0C4 11 (Page Translation Excep... PL/I & Assembler 16
Search our Forums:

Back to Top