Skip to Content
Author's profile photo Former Member

Cracking SAP Memory Management _Part2

Hope the first blog was useful,  Lets talk memory in an SAP Perspective more precisely SAP ABAP Perspective.

In an SAP System each step is a transaction step .An SAP transaction  consists of several transaction steps . Data corresponding to these transaction steps are stored in  Application server memory. This is called a User Context. IT will be useful later 🙂

Session

What is a session in SAP , Data from transaction steps executed in two different sessions are stored in two different memory areas. For a new session a new User context is also created.

Session.png

Lets put it this way every session has a burden in memory .Because there are user contexts created for each  session

What is SAP Roll Memory??

The  initial part of the user context is local SAP roll Area of the work process. Since it is local memory each SAP Work Process can access only its own roll area.  At the end of transaction step the user exits the work process so that another user can use the work process. The local roll area is copied to shared SAP Roll area as shown in  the figure.

The shared roll area is  either a memory area  in the shared memory of the application server (SAP Roll Buffer ) or application Servers hard drive (the SAP Roll file) or  a combination of both. The shared Roll area is accessible by all of an instance’s work process.

What is Roll out?

At the end of transaction step the user exits the work process so that it can be used by another work process. The process of copying the Local Roll Memory to Shared Roll Area is called Roll out.

What is Roll In?

When user is assigned to a new/different work process , the user context is copied from the shared roll Area  to local Roll Area . This procedure is called Roll In.

Ztta/roll_area specifies the size of the local SAP Roll Area . It applies equally to all the work processes.

rdisp/ROLL_MAXFS defines the size of the entire SAP Shared roll area.(i.e Roll File +Roll Buffer)

SAP_roll.png

I know there are a lot of terms being discussed here but it will be useful soon when we discuss about memory management and distribution. I hope the following terms are clear.

  • User Context
  • Session
  • SAP Roll Area 
  • SAP Roll Buffer

If you understand the following points correctly ,  The next term to introduce is extended memory . I promise you there are not too many SAP terminology after this , if you  understand the First Part of the blog and the above terms which is easier. I still have to read it again  to get the basics  right 

IMPORTANT

The frequency of roll out and roll in are higher considering the transaction steps , so the less heavy the user context the better. For the same reason Mostly User Contexts are stored in Extended Memory ( I know new term again) which is shared so that Roll in and Roll out are made faster because less  amount of data needs to be exchanged. This is done by storing only the address of the extended memory is stored in the local memory of the work process. (The following diagram helps to understand the concept better)

Have a good day….

Assigned Tags

      14 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Akshay Gupta
      Akshay Gupta

      Jacob,

      Informational blogs, keep it up.

      It would be great if you could link these two up with the URLs of previous/following part in each other.

      Regards,

      Akshay

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thank you Askash ...The comments are really motivating..I will link up the blogs once finished the series...

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Author's profile photo Jeff McDonald
      Jeff McDonald

      Hi Jacob - Great work!  Very good information, presented well.  Looking forward to the rest of the series.

      Thanks - Jeff

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Thank you Jeff...I will post soon once finishes my writing..

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Author's profile photo Ankit Mishra
      Ankit Mishra

      Hi Jacob,

      Thanks for sharing the info. I was actulally looking for this and more.

      Want to know about Heap memory.

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Ankit...

      Thanks for the comments...

      .What you wanted to know about Heap memory ? Most of the system it is automatically configured nowadays..

      Which system Version..I will try to help ..

      Kind Regards,

      Jacob

      Author's profile photo Ankit Mishra
      Ankit Mishra

      Hello Jacob,

      Thanks for the extended help!!

      Here is my task:

      We have a BI system, which has 3 app servers.

      Two of them have 32Gb and one of them has 48Gb as RAM.

      We need to increase the memory parameters for it to resolve frequent ocurring memory dumps like "tsv_tnew_page_alloc_failed" "Resourse Shortage".

      Resolution:

      This is what we have recommended on the server which has 48 Gb as RAM

      em/initial_size_MB= 24 Gb

      ztta/roll_extension= 6 Gb 

      abap/heap_area_total= 24 Gb

      abap/heap_area_dia= 6Gb

      Let me know your thoughts.

      Thanks and Regards,

      Ankit Mishra

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Ankit,

      This means  simply the memory of the user context is used ,  Is it for the all the users for that specific user.I knoe normally tend to sit on BASIS guys head to resolve...

      Normally I will ask the user to optimize  his program....

      Is it unix or windows operating system? Can you give more error details...?

      Kind Regards,

      Jacob

      Author's profile photo Ankit Mishra
      Ankit Mishra

      Hello Jacob,

      Regret for the late reply.

      We have Red Hat linux 5.

      We did ask the BW team to optimize their program but to no avail.

      On that particular Server where RAM is 48Gb, SWAP is 16Gb

      Here is a detail of one of the errors:

      The amount of storage space (in bytes) filled at termination time was:

      Roll area...................... 12726272
      Extended memory (EM)........... 4001693760
      Assigned memory (HEAP)......... 4000062192
      Short area..................... " "
      Paging area.................... 32768
      Maximum address space.......... 18446696972701972495

      Author's profile photo Ankit Mishra
      Ankit Mishra

      Hello Jacob,

      Regret for the late reply.

      We have Red Hat linux 5.

      We did ask the BW team to optimize their program but to no avail.

      On that particular Server where RAM is 48Gb, SWAP is 16Gb

      Here is a detail of one of the errors:

      The amount of storage space (in bytes) filled at termination time was:

      Roll area...................... 12726272
      Extended memory (EM)........... 4001693760
      Assigned memory (HEAP)......... 4000062192
      Short area..................... " "
      Paging area.................... 32768
      Maximum address space.......... 18446696972701972495

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hello Ankit,

      I have sent you a private message with some steps...

      Kind Regards,

      Jacob

      Author's profile photo Ankit Mishra
      Ankit Mishra

      Thanks Jacob!! Will work on it.