0 Replies Latest reply: Dec 30, 2011 11:10 AM by 826510 RSS

    understand the memory consumption in Solaris

    826510
      Hi All,

      There is some things that I don't understand on Solaris, regarding the memory utilization.

      In my research on google, I have found this very usefull command : echo "::memstat" | mdb -k

      the output is :
      ________________________________________________________
      root@localhost > echo "::memstat" | mdb -k
      Page Summary Pages MB %Tot
      ------------ ---------------- ---------------- ----
      Kernel 290375 1134 7%
      ZFS File Data 55829 218 1%
      Anon 82841 323 2%
      Exec and libs 9844 38 0%
      Page cache 10370 40 0%
      Free (cachelist) 15677 61 0%
      Free (freelist) 3726068 *14554* 89%

      Total 4191004 16371
      Physical 4101523 16021
      _______________________________________________________

      I already know the vmstat command :
      ______________________________________________________
      root@PA-OFC-SRV-UAT-1 > vmstat 2
      kthr memory page disk faults cpu
      r b w swap free re mf pi po fr de sr lf s0 s1 -- in sy cs us sy id
      0 0 0 16286044 14528236 24 106 0 0 0 0 1 0 -0 2 0 704 950 410 0 0 100
      0 0 0 16390660 14629360 6 24 0 0 0 0 0 0 0 0 0 680 346 390 0 0 100
      0 0 0 16390572 14629308 1 2 0 0 0 0 0 0 0 0 0 685 219 362 0 0 100
      0 0 0 16390572 *14629308* 1 1 0 0 0 0 0 0 0 0 0 680 274 342 0 0 100
      ^C
      _____________________________________________________

      The thing that I don't understand is the difference between the 2 output for the free memory:

      FREE for mdb : 14554 MB -> 14.2 Go
      FREE for vmstat : 14629308 kb -> 14286.4MO -> 13.9Go

      I can tell that nothing is runing on my system (except the OS)

      The difference is not very big 0.3 as on this server I have :

      Memory size: 16380 Megabytes. (prtconf)

      A strange thing is that I have successfully started a java process with 15go (so 15360 Mo), even if I have 14554 MB:
      _______________________________________________________________________________
      root@localhost > java -d64 -Xms15G -version
      java version "1.6.0_23"
      Java(TM) SE Runtime Environment (build 1.6.0_23-b05)
      Java HotSpot(TM) 64-Bit Server VM (build 19.0-b09, mixed mode)

      root@localhost > /home/ullink/COMMON/JAVA/latest/bin/java -d64 -Xms16G -version
      Error occurred during initialization of VM
      Could not reserve enough space for object heap
      ______________________________________________________________________________


      BUT, on a servers which I have 73720 Megabytes (prtconf), the difference is bigger:

      ________________________________________________________________________________
      root@host > echo "::memstat" | mdb -k
      Page Summary Pages MB %Tot
      ------------ ---------------- ---------------- ----
      Kernel 662611 2588 3%
      ZFS File Data 998688 3901 5%
      Anon 2139403 8357 11%
      Exec and libs 13959 54 0%
      Page cache 35561 138 0%
      Free (cachelist) 97387 380 1%
      Free (freelist) 14922431 *58290* 79%

      Total 18870040 73711
      Physical 18362749 71729
      _________________________________________________

      vmstat:
      ________________________________________________

      root@host > vmstat 2
      kthr memory page disk faults cpu
      r b w swap free re mf pi po fr de sr lf s1 s2 s3 in sy cs us sy id
      0 0 0 50601596 60622968 64 179 0 0 0 0 0 0 1 0 0 1112 11666 959 0 0 100
      0 0 0 48801836 58047100 59 78 0 0 0 0 0 0 0 0 0 1163 1200 860 0 0 100
      3 0 0 48801756 58047480 246 929 0 0 0 0 0 0 0 0 0 1160 194171 968 1 0 99
      0 0 0 48801556 *58047224* 149 656 0 0 0 0 0 0 0 0 0 1186 183253 980 1 0 99
      ^C
      _________________________________________________

      so here I have:
      FREE for mdb -> 58290mb --> 56.9Go
      FREE for vmstat -> 58047224 b --> 55.35Go

      so here I have a difference of 1.5Go....

      I have the feeling that when more we have memory, more the difference is big.

      I investigate on this because on this (last) server, the production team of my compagny told me that they don't know "where" are some GB of RAM on this server....so I try to understand....

      I don't say that all my interpretation are good, but there is something I don't understand...

      so the question I have are :

      - why was I able to start a java process with 15G?
      - what is the difference between mdb and vmstat?

      Thank you a lot in advance