3 Replies Latest reply on Feb 2, 2013 10:34 PM by bigdelboy

    Is there a way to free up memory in Solaris


      I am wondering if there is a way to free up memory in Solaris manually ? the way we can do it in Linux for example :

      [xml]echo `/bin/date` "************* Memory Info Before *************"
      free -m
      echo 1 > /proc/sys/vm/drop_caches
      echo 2 > /proc/sys/vm/drop_caches
      echo 3 > /proc/sys/vm/drop_caches
      echo `/bin/date` "************* Memory Info After *************"
      free -m[xml]

        • 1. Re: Is there a way to free up memory in Solaris

          I have two Solaris 11 VMs with Oracle Clusterware running on VBox, both of them with 4GiB RAM, problem is they get slower and slower and then all of a suden one of them gets crashed, it happens so frequently that I just cannot work, increasing RAM is out of question, previously I was running the same setup on Oracle Linux 5 and I was able to tweak the memory using the above script and never got a crash.

          I need to find a way to tune the memory in solaris so the VMs can stay up and I can do the work.

          Here are the mem stats from one of the server, this will give you an idea as to whats happening and you may be able to suggest me a way to tune them.

          Just to let you know I am very new in Solaris so every bit of information will be very helpful to get this problem resolved.

          echo ::memstat | mdb -k
          Page Summary                Pages                MB  %Tot
          ------------     ----------------  ----------------  ----
          Kernel                     202104               789   19%
          ZFS File Data                9039                35    1%
          Anon                       750232              2930   72%
          Exec and libs               34059               133    3%
          Page cache                  36889               144    4%
          Free (cachelist)             6119                23    1%
          Free (freelist)             10021                39    1%
          Total                     1048463              4095
          Please have a look at above stats and suggest me what to do.

          Thank you very much for your assistance !


          • 2. Re: Is there a way to free up memory in Solaris

            Use echo ::memstat | mdb -k with some delay for analyze how memeory usage.

            You can set limits for using memory by ZFS. (zfs_arc_max)

            Add line to /etc/system

            set zfs:zfs_arc_max =104857600


            • 3. Re: Is there a way to free up memory in Solaris
              Keeping it simple:

              The key indicator to watch is usually: /usr/sbin/swap -s

              This tells you have much virtual memory you have left.

              ... If zfs_arc_cache is not constrained and allowed to grow unfettered this indicator will show falsely low .... ( because zfs_arc_cache will give up memory).



              If virtual memory is short you can normally increase it by adding space to your zfs swap device ... or simply adding an extra zfs swap device ....



              Whilst this may help avoid a crash it risks performance degradation due to excessive paging (monitor with vmstat -p) unless additional ram is allocated to the VM.
              (Additionally with virtualbox the underlying OS could also be paging to disk).


              Be aware I sometimes get some of this stuff wrong. And it is sometimes possible for other things to cause the crash. But in general Solaris will try to make the best ue of what is believes is physical ram that it can.