VirtualBox

Changeset 36071 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Feb 24, 2011 3:02:10 PM (14 years ago)
Author:
vboxsync
Message:

Main/src-server/PerformanceSolaris: Tweak free memory accounting to include ZFS arc c_min.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/solaris/PerformanceSolaris.cpp

    r28800 r36071  
    2626#include <sys/sysinfo.h>
    2727#include <sys/time.h>
     28#include <syslog.h>
    2829
    2930#include <iprt/err.h>
     
    8586CollectorSolaris::~CollectorSolaris()
    8687{
    87     kstat_close(mKC);
     88    if (mKC)
     89        kstat_close(mKC);
    8890}
    8991
     
    191193        {
    192194            if ((kn = (kstat_named_t *)kstat_data_lookup(mZFSCache, "size")))
    193                 *available += (kn->value.ul / 1024);
     195            {
     196                ulong_t ulSize = kn->value.ul;
     197
     198                if ((kn = (kstat_named_t *)kstat_data_lookup(mZFSCache, "c_min")))
     199                {
     200                    /*
     201                     * Account for ZFS minimum arc cache size limit.
     202                     * "c_min" is the target minimum size of the ZFS cache, and not the hard limit. It's possible
     203                     * for "size" to shrink below "c_min" (e.g: during boot & high memory consumption).
     204                     */
     205                    ulong_t ulMin = kn->value.ul;
     206                    *available += ulSize > ulMin ? ulSize - ulMin : 0;
     207                }
     208                else
     209                    Log(("kstat_data_lookup(c_min) ->%d\n", errno));
     210            }
    194211            else
    195212                Log(("kstat_data_lookup(size) -> %d\n", errno));
     
    209226    return rc;
    210227}
     228
    211229int CollectorSolaris::getProcessMemoryUsage(RTPROCESS process, ULONG *used)
    212230{
     
    243261}
    244262
    245 }
    246 
     263
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette