2 Replies Latest reply on Oct 9, 2013 2:33 PM by Asif Muhammad

    Increase/Decrease Swap Area size

    Tushar Lapani

      Hi friends!!!

      I am running my Oracle 11G database on Linux Redhat 6.0 system. when I execute free -m command it returns output as follow.

      [oracle@s1 vm]$ free -m

                   total       used       free     shared    buffers     cached

      Mem:    3960       3913         46          0        183       2692

      -/+ buffers/cache:       1037       2922

      Swap:    3055       3055          0


      So I want to know

      1. Is my swap area size is enough or not.

      2. Is it better to have more Swap area?

      3. Is it wise that system use maximum (100%)Swap area  as possible it can do?

      4. What happen if my swap are is being used maximum?

      5. Is swap area is related in any way with tmpfs

        • 1. Re: Increase/Decrease Swap Area size
          1. Swap space is no substitute for RAM. The problem is you do not have enough physical memory available. If you are running a 32-bit system, consider upgrading to a 64-bit OS and install more memory.
          2. Check the documentation, it has some size recommendations for creating swap partitions. Rebuilding memory from a swap file means a lot of unnecessary I/O and will slow down the machine.
          3. If you are running out of physical memory and swap, your kernel will start to kill processes in order to keep the core system running. Alternatively, create a swap file on demand. See my last response at Re: commands to resize swap
          4. See 2. and 3.
          5. Possibly, POSIX shared memory (/dev/shm) can be swapped if there is insufficient memory.
          • 2. Re: Increase/Decrease Swap Area size
            Asif Muhammad



            Your swap size is not enough. Your server is consuming more memory than what is really allocated. Both physical and swap memory seems in adequate. THe general rule of thump for allocating swap size is:

            If physical memory is < 2 GB, then  swap size should be MEMORY SIZE * 2

            If physical memory is between 2 and 8 GB then swap size should be MEMORY SIZE * 1.5

            If physical memory is  > 8 GB, then swap size should be MEMORY SIZE * 1


            I suggest you add more physcial memory in addition to worry about swap memory, As there is inadquate memory provide heavy paging will occur and swap size usage will mean extra I/O happening as the swap size is in the Hard disk.


            Thanks &

            Best Regards,