Skip to Content
avatar image
Former Member

Swap space becomes critically low in the system

Hi,

We are facing a situation where the swap space space  is critically low in the system, there is just 10 % available swap space in the system

And we can't see the swap space being released to the OS .

This is one of the  Application servers we have for R3 system.

SAP environment:

SAP Netweaver 7.01

LINUX RHEL

Oracle 11g

$free -m //outut

As you can see we have 64G physical memory allocated to this application server whereas the configured swap space is around 20G.

This Linux box houses two application server one for R3 and the other for CRM.

Would appreciate if you can tell me what should be done to release the swap space as above shows that 18 gig of 20 is being used right now.

Regards,

Rakesh

R3_free m.PNG (8.0 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Mar 15, 2014 at 10:14 AM

    Hi Rakesh,

    If you have some free space on the system then follow below e.g to extend swap space:

    To add a swap file:
    1. Determine the size of the new swap file and multiple by 1024 to determine the block size. For example, the block size of a 64 MB swap file is 65536.


    2. At a shell prompt as root, type the following command with count being equal to the desired block size:
    # dd if=/dev/zero of=/swapfile bs=1024 count=65536
    3. Setup the swap file with the command:


    # mkswap /swapfile


    4. To enable the swap file immediately but not automatically at boot time:

    # swapon /swapfile


    5. To enable it at boot time, edit /etc/fstab to include:
    /swapfile swap swap defaults 0 0


    The next time the system boots, it will enable the new swap file.
    6. After adding the new swap file and enabling it, make sure it is enabled by viewing the output of the command cat /proc/swaps or free.

    -------------------------------------------------------------------

    To disable the temporary swap space execute the following commands:

    1.
    # su - root
    2.
    # swapoff swapfile
    3.
    # rm swapfile

    Regards,

    Gaurav

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks Gaurav..

      what you have said makes sense we will check that parameter which determines to what extent swap space should be used between 0 to 100 %.

      However, I have found that there are many swaps in the SAP buffer (ST02) that we will be tuning soon in both of the application servers that I had mentioned above,

      I have checked the ST06 and couldn't found any page in/out activity.

      see below the screen shots of  ST02 and ST06 for both application servers.

      Regards,

      Rakesh

      cp1 pic1.PNG (21.7 kB)
      P10 pic1.PNG (34.6 kB)
      P10 pic2.PNG (10.9 kB)
      CP1 pic2.PNG (10.8 kB)
  • Mar 15, 2014 at 10:12 AM

    Hi Rakesh

    1. Stop the both the SAP instance, check the swap space released or not? if the result same just do the OS level

    2. After restart the OS before starting the SAP instance check the swap and after start the SAP instance

    3.Kindly refer the SAP Notes

    1597355 - Swap-space recommendation for Linux

    941735 - SAP memory management for 64-bit Linux systems

    171356 - SAP software on Linux: General information

    based on this you can increase the swap

    Regards

    Sriram

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 19, 2014 at 08:18 AM

    Hi,

    We have  to reboot the physical server to release teh SWAP space which dropped to critically low 4%.

    Before reboot, I stopped the SAP apps and that alone  released the sap space more than 50% ,however I went ahead and took the bounce of the server.

    Clearly as we can see, there is no SWAP space in use right now and it will start allcoating once there is load on the server.

    My question is, why sometimes we don't see the memory allocated by SWAP returns back to the OS as normally would be the case.

    Could this be because of some bug  in the OS?

    We have this version of RHEL:

    $ cat /etc/redhat-release

    Red Hat Enterprise Linux Server release 5.7 (Tikanga)

    -sh-3.2$

    Add comment
    10|10000 characters needed characters exceeded