Giter Club home page Giter Club logo

Comments (4)

vlmarek avatar vlmarek commented on June 7, 2024

Hmm, do we speak about kernel zone? I have made a test case:

#!/bin/bash                                                                                                                                                   
set -x                                                                                                                                                        
KSTAT2=/usr/bin/kstat2                                                                                                                                        
PAGE_SIZE=$(/usr/bin/pagesize)                                                                                                                                
TOTAL_MEMORY_PAGES=$($KSTAT2 -p kstat:/vm/usage/memory:mem_total | cut -f 2)                                                                                  
FREE_MEMORY_PAGES=$($KSTAT2 -p kstat:/pages/unix/system_pages:freemem | cut -f 2)                                                                             
ZFS_MEMORY_PAGES=$($KSTAT2 -p kstat:/vm/usage/memory:mem_zfs | cut -f 2)                                                                                      
AVAILABLE_MEMORY_PAGES=$(( $FREE_MEMORY_PAGES + $ZFS_MEMORY_PAGES ))                                                                                          
AVAILABLE_MEMORY_PERCENTAGE=$(( 100*$AVAILABLE_MEMORY_PAGES/$TOTAL_MEMORY_PAGES ))                                                                            

In my zone I have

$ prtconf | head -2
System Configuration:  Oracle Corporation  i86pc
Memory size: 4094 Megabytes

$ bash a.sh
+ KSTAT2=/usr/bin/kstat2
++ /usr/bin/pagesize
+ PAGE_SIZE=4096
++ /usr/bin/kstat2 -p kstat:/vm/usage/memory:mem_total
++ cut -f 2
+ TOTAL_MEMORY_PAGES=1047965
++ /usr/bin/kstat2 -p kstat:/pages/unix/system_pages:freemem
++ cut -f 2
+ FREE_MEMORY_PAGES=555988
++ /usr/bin/kstat2 -p kstat:/vm/usage/memory:mem_zfs
++ cut -f 2
+ ZFS_MEMORY_PAGES=162092
+ AVAILABLE_MEMORY_PAGES=718080
+ AVAILABLE_MEMORY_PERCENTAGE=68

That looks ok to me. Would you mind running that snipped and/or be more specific about the errors, please?

from solaris-userland.

cgrzemba avatar cgrzemba commented on June 7, 2024

no, not on kernel zone, in simple locale zone

from solaris-userland.

alanc avatar alanc commented on June 7, 2024

On Solaris 11.4? kstat2 was introduced in 11.4, so this won't work on older releases, but neither will many other things in the Userland build.

from solaris-userland.

cgrzemba avatar cgrzemba commented on June 7, 2024

Thanks, this explains it!

from solaris-userland.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.