14.01.2020 Views

ABAP_to_the_Future

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

14

Shared Memory

phone, because then you have two people waiting for the hourglass to finish. This

must be what happens whenever I phone a bank or similar institution.)

Problems with memory usage arise when there is a duplication of the exact same

data in a large number of individual user sessions. For ex ample, you may have

been called on to investigate runtime er rors in which the user’s session terminates

with a ROLL_NO_AREA dump or one of its close friends. If you read the text in

the short dump, then you will see that an internal table has reached a very large

number of rows and then tried to append another row, and the SAP system says

“this is the straw that breaks the camel’s back” and declares that there is just not

enough room in memory to store such a huge amount of data in an individual

user session. If an individual user sess ion is hogging a huge amount of memory,

then it can affect the system as whole. If the system is to remain healthy enough

for everything to go swimmingly for everybody, then programmers should try to

minimize the amount of data held in memory at any one time. This is why SAP

has tools such as the Memory Inspector, which watches out for memory leaks in

long-running transactions like CIC0, in which if you are not careful the amount of

memory used just goes up and up until the out-of-memory dump occurs.

At the end of the day, bo th problems with database access and memory usage

cause runtime errors or short dumps, which not only are annoying to the individual

users but also often interfere with the running of the system as a whole,

which is annoying to every single user. Shared memory can address both issues,

and this chapter will show you how.

Section 14.1 gives a general introducti on to the problem the shared memory

framework was created to address and how the framework go es about solving

those problems. Section 14.2 talks about the mechanics of how shared memory

objects are created and used in the ABAP language, which is quite complicated.

Once you’ve got the data in shared memory, you have to make sure that it is

exactly the same as the equivalent data in the database; this process is the subject

of Section 14.3. Finally, Section 14.4 provides some tips for troubleshooting common

problems.

14.1 The Promises of Shared Memory

As noted in the chapter introduction, the goal of shared memory is to solve two

big problems: database access and memo ry usage. This section will outline,

briefly and on a high level, how shared memory goes about this.

632

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!