File cache portion of memory on Solaris


 
Thread Tools Search this Thread
Operating Systems Solaris File cache portion of memory on Solaris
# 1  
Old 04-20-2009
File cache portion of memory on Solaris

I'm looking to get the file cache portion of physical (real) memory on a Solaris workstation (Similar to the Cache: line in /proc/meminfo on some Linux systems):


Code:
# swap -s; swap -l; vmstat 2 2; echo "::memstat" | mdb -k
total: 309376k bytes allocated + 41428k reserved = 350804k used, 659608k available
swapfile             dev  swaplo blocks   free
/dev/dsk/c0d0s1     102,1       8 1060280 1060280
 kthr      memory            page            disk          faults      cpu
 r b w   swap  free  re  mf pi po fr de sr cd f0 s0 s1   in   sy   cs us sy id
 0 0 0 719880 258132 27 191 13  0  0  0 11  2 -0  0  0  729  829  282  1  2 97
 0 0 0 659480 194148  6  13  0  0  0  0  0  0  0  0  0  422  392  291  1  1 98
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                      48091               187   25%
Anon                        79067               308   41%
Exec and libs                9215                35    5%
Page cache                  10138                39    5%
Free (cachelist)            29622               115   15%
Free (freelist)             18313                71    9%

Total                      194446               759



# kstat -c "vm"
module: unix                            instance: 0
name:   segadvstat                      class:    vm
        crtime                          0
        MADV_FREE_hit                   0
        MADV_FREE_miss                  0
        snaptime                        7130.983197642

module: unix                            instance: 0
name:   segmap                          class:    vm
        crtime                          0
        fault                           52391
        faulta                          0
        free                            9035
        free_dirty                      352
        free_notfree                    289
        get_nofree                      0
        get_nomtx                       0
        get_reclaim                     191362
        get_reuse                       9657
        get_unused                      0
        get_use                         52
        getmap                          203118
        pagecreate                      8672
        rel_abort                       0
        rel_async                       3987
        rel_dontneed                    861
        rel_free                        3130
        rel_write                       1267
        release                         198721
        snaptime                        7130.984527215
        stolen                          0

module: unix                            instance: 0
name:   vminfo                          class:    vm
        crtime                          0
        freemem                         27160999
        snaptime                        7130.985584569
        swap_alloc                      12657123
        swap_avail                      58227860
        swap_free                       61179173
        swap_resv                       15608436


	
	
	
# kstat -c "pages"
module: unix                            instance: 0
name:   system_pages                    class:    pages
        availrmem                       145498
        crtime                          0
        desfree                         1519
        desscan                         25
        econtig                         4274888704
        fastscan                        97223
        freemem                         63558
        kernelbase                      3556769792
        lotsfree                        3038
        minfree                         759
        nalloc                          23522767
        nalloc_calls                    13856
        nfree                           23385080
        nfree_calls                     9104
        nscan                           0
        pagesfree                       63558
        pageslocked                     48948
        pagestotal                      194446
        physmem                         194446
        pp_kernel                       50463
        slowscan                        100
        snaptime                        7184.196494221


kstat gives me hundreds of options but it's not clear to me where Solaris keeps the portion of memory for caching things like libraries and other system files it regularly needs.

Both Linux and AIX have the values but can't seam to locate the same on the Solaris system. Also, I'm aware that MemTools can report this but MemTools is not an option for me.

Also,
Is the portion of physical memory used allocated to the cache?
Is it part of the physical memory allocated to swap?

Thank you,
# 2  
Old 04-21-2009
Perhaps you take a look here:

Page cache hit ratio - Siwiki

cu
lowbyte
# 3  
Old 04-22-2009
Hi,

Thanks. Going through it I don't see any specific calculation for Page Cache total used by fs execs and libraries etc. To put it differently, I'm basically interested to know how mdb -k using ::memstat calculated the below values:

Exec and libs 9215 35 5%
Page cache 10138 39 5%

I'm interested in getting the same numbers using kstat or other built ins but can't find decent documentation or an explanation of kstat values to be able to tell what all of them mean. I'm also interested to know if this value resides within the used portion of memory as reported by vmstat 'free' field, which I would expect as I'm finding hints here and there that this portion resides elsewhere and wanted to clear this up.

Thanks,
# 4  
Old 04-23-2009
Quote:
Originally Posted by Devyn
I'm looking to get the file cache portion of physical (real) memory on a Solaris workstation (Similar to the Cache: line in /proc/meminfo on some Linux systems)
Assuming you are only using UFS and no ZFS, the file cache is displayed in this line on your report:
Code:
 Free (cachelist)            29622               115   15%

Note that this cache is accounted as free memory as it is available for any use.
Code:
kstat gives me hundreds of options but it's not clear to me where Solaris keeps the portion of memory for caching things like libraries and other system files it regularly needs.

Only pages are cached, i.e. portions of files that are actually used, not whole files.
Quote:
Is the portion of physical memory used allocated to the cache?
Is it part of the physical memory allocated to swap?
The file cache is obviously RAM based. There would be no interest to cache disks blocks into different other disk blocks.

Last edited by jlliagre; 06-11-2009 at 05:32 AM.. Reason: typo
# 5  
Old 06-10-2009
Thanks jlliagre. That moves me forward.

> Only pages are cached, i.e. portions of files that are actually used, not whole files.
Ok. That's fine too. Would you know which parts of kstat output shows the total # of pages cached or at least which vars contain this so I can calculate this?

> Assuming you are only using UFS and no FZS, the file cache is displayed in this line on your report:
Yes I know. I was interested in getting this number using kstat values as mdb is slow and because of this impractical.

> Also,
> Is the portion of physical memory used allocated to the cache?
> Is it part of the physical memory allocated to swap?
-> The file cache is obviously RAM based. There would be no interest to cache disks
-> blocks into different other disk blocks.

Yes of course. Let me rephrase. On Solaris, the memory reported by vmstat per my understanding already does not include cache. Solaris considers the cache portion as memory it can grab as needed so it sees it as free. This makes sense to me and so any usage reported through Solaris commands is the portion used that is not cache. Please correct me if I'm wrong.

In light of above, of the physical ram Solaris sees as free, what portion of that is Cache?

Again, thank you for the help so far.
# 6  
Old 06-11-2009
Quote:
Originally Posted by Devyn
Ok. That's fine too. Would you know which parts of kstat output shows the total # of pages cached or at least which vars contain this so I can calculate this?
None.
Quote:
Yes I know. I was interested in getting this number using kstat values as mdb is slow and because of this impractical.
My understanding is this statistic isn't maintained in real-time so must be computed by analysing the pages. The reason why ::memstat is slow.

Quote:
Yes of course. Let me rephrase. On Solaris, the memory reported by vmstat per my understanding already does not include cache. Solaris considers the cache portion as memory it can grab as needed so it sees it as free. This makes sense to me and so any usage reported through Solaris commands is the portion used that is not cache. Please correct me if I'm wrong.
This is correct for UFS, not for ZFS.
Quote:
In light of above, of the physical ram Solaris sees as free, what portion of that is Cache?
This information isn't available from kstat output.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Memory and cache access time discrepancy

#include<stdio.h> #include<stdlib.h> #include<sys/time.h> #include<time.h> #include "rdtsc.h" #define SIZE 4*64*1024 int main() { unsigned long long a,b; int arr={0}; int i; register int r; a=rdtsc(); r=arr; b=rdtsc(); printf("1st element Access Cycles = %llu\n",b-a); (2 Replies)
Discussion started by: Vaibhavs1985
2 Replies

2. UNIX for Dummies Questions & Answers

Clearing memory cache on Linux server

i wish to clear memory cache on a production box and i was wondering what is the worst that can happen if i do? i already tested this on a backup server and everything seemed fine. but i need to know from you experts what are the worst things that can happen when i run it on a real server: ... (5 Replies)
Discussion started by: SkySmart
5 Replies

3. Solaris

clear cache memory

hi all, i have noticed that my server has 64 GB RAM and i have application in this server but the server has free memory only 15% and utilized 85% however it didn't eat from swap . does any parameter can be configured in kernel to make the system clear memory from cache like linux i found... (4 Replies)
Discussion started by: maxim42
4 Replies

4. Programming

Ways to preserve a memory cache

The environment is Java/Windows. The program keeps near real-time state in memory cache, which is updated by multiple sources, size of the cache is roughly 500 MB, frequency of updates is ~ 20 per second. I am looking into different ways to keep current snapshot of the memory on the disk for a)... (9 Replies)
Discussion started by: migurus
9 Replies

5. Programming

How access a specific memory portion through printf() function????

Hi friends, Hope everyone is doing well. Please have a look at this simple program, you will figure out what I want. #include <stdio.h> int main() { printf("Enter an integer!\n"); scanf( "%d", 134511890 ); // Valid address on my computer printf( "%d\n", ???? ); return 0; } ... (3 Replies)
Discussion started by: gabam
3 Replies

6. Red Hat

Need to release Cache memory

Right now i am using Red Hat Enterprise Linux AS release 4 and cache memory occupying around 1.5GB mentioned below, total used free shared buffers cached Mem: 2026 2021 5 0 161 1477 -/+ buffers/cache: 382 1644 ... (4 Replies)
Discussion started by: thakshina
4 Replies

7. Linux

File cache /Page cache Linux

Hi All, could any one point out any open source test-suites for "File cache" testing and as well as performance test suites for the same. Currently my system is up with Linux/ext4. Regards Manish (0 Replies)
Discussion started by: hmanish
0 Replies

8. UNIX for Dummies Questions & Answers

High use of cache memory

Hi, I'm running a debian lenny 1GB ram, but with a high I/O. This server has 400IOPS and 3MB/s sustain. So, I noted cached memory use 800MB, buffered memory use 50MB, and no free memory is available. Questions: What does mean such a high cached memory? Who's using this cached memory? Is... (3 Replies)
Discussion started by: iga3725
3 Replies

9. Solaris

Solaris File Cache

I started a previous thread : https://www.unix.com/sun-solaris/76721-coredumps-swap-part-solaris-mem-consumption.html But my fault as there is no xml feed for this forum i lost track and thread got closed. So in the mean time i went through some docs and here are my queries : 1. mdb -k... (2 Replies)
Discussion started by: rajwinder
2 Replies

10. Windows & DOS: Issues & Discussions

Clearing of cache memory

Pls! will someone help me on how to clear my cache memory of my Internet browser Thanks Kayode (3 Replies)
Discussion started by: kayode
3 Replies
Login or Register to Ask a Question