当前位置: 首页>>代码示例>>C++>>正文


C++ ProcessInfo::getResidentSize方法代码示例

本文整理汇总了C++中ProcessInfo::getResidentSize方法的典型用法代码示例。如果您正苦于以下问题:C++ ProcessInfo::getResidentSize方法的具体用法?C++ ProcessInfo::getResidentSize怎么用?C++ ProcessInfo::getResidentSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProcessInfo的用法示例。


在下文中一共展示了ProcessInfo::getResidentSize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: printMemInfo

 void printMemInfo( const char * where ){
     cout << "mem info: ";
     if ( where ) 
         cout << where << " "; 
     ProcessInfo pi;
     if ( ! pi.supported() ){
         cout << " not supported" << endl;
         return;
     }
     
     cout << "vsize: " << pi.getVirtualMemorySize() << " resident: " << pi.getResidentSize() << " mapped: " << ( MemoryMappedFile::totalMappedLength() / ( 1024 * 1024 ) ) << endl;
 }
开发者ID:anagri,项目名称:mongo,代码行数:12,代码来源:mmap.cpp

示例2: JSGetMemInfo

BSONObj JSGetMemInfo(const BSONObj& args, void* data) {
    ProcessInfo pi;
    uassert(10258, "processinfo not supported", pi.supported());

    BSONObjBuilder e;
    e.append("virtual", pi.getVirtualMemorySize());
    e.append("resident", pi.getResidentSize());

    BSONObjBuilder b;
    b.append("ret", e.obj());

    return b.obj();
}
开发者ID:Andiry,项目名称:mongo,代码行数:13,代码来源:shell_utils.cpp

示例3: printMemInfo

void printMemInfo(const char* where) {
    LogstreamBuilder out = log();
    out << "mem info: ";
    if (where)
        out << where << " ";

    ProcessInfo pi;
    if (!pi.supported()) {
        out << " not supported";
        return;
    }

    out << "vsize: " << pi.getVirtualMemorySize() << " resident: " << pi.getResidentSize()
        << " mapped: " << (MemoryMappedFile::totalMappedLength() / (1024 * 1024));
}
开发者ID:Andiry,项目名称:mongo,代码行数:15,代码来源:mmap.cpp

示例4: sayMemoryStatus

 /** called once a minute from killcursors thread */
 void sayMemoryStatus() { 
     static time_t last;
     static Mem mlast;
     try {
         ProcessInfo p;
         if ( !cmdLine.quiet && p.supported() ) {
             Mem m;
             m.res = p.getResidentSize();
             m.virt = p.getVirtualMemorySize();
             m.mapped = MemoryMappedFile::totalMappedLength() / (1024 * 1024);
             time_t now = time(0);
             if( now - last >= 300 || m.grew(mlast) ) { 
                 log() << "mem (MB) res:" << m.res << " virt:" << m.virt;
                 long long totalMapped = m.mapped;
                 if (cmdLine.dur) {
                     totalMapped *= 2;
                     log() << " mapped (incl journal view):" << totalMapped;
                 }
                 else {
                     log() << " mapped:" << totalMapped;
                 }
                 log() << " connections:" << connTicketHolder.used();
                 if (theReplSet) {
                     log() << " replication threads:" << 
                         ReplSetImpl::replWriterThreadCount + 
                         ReplSetImpl::replPrefetcherThreadCount;
                 }
                 last = now;
                 mlast = m;
             }
         }
     }
     catch(const std::exception&) {
         log() << "ProcessInfo exception" << endl;
     }
 }
开发者ID:89snake89,项目名称:mongo,代码行数:37,代码来源:clientcursor.cpp

示例5: sayMemoryStatus

 /** called once a minute from killcursors thread */
 void sayMemoryStatus() { 
     static time_t last;
     static Mem mlast;
     try {
         ProcessInfo p;
         if ( !cmdLine.quiet && p.supported() ) {
             Mem m;
             m.res = p.getResidentSize();
             m.virt = p.getVirtualMemorySize();
             m.mapped = (int) (MemoryMappedFile::totalMappedLength() / ( 1024 * 1024 ));
             if( time(0)-last >= 300 || m.grew(mlast) ) { 
                 log() << "mem (MB) res:" << m.res << " virt:" << m.virt << " mapped:" << m.mapped << endl;
                 if( m.virt - (cmdLine.dur?2:1)*m.mapped > 5000 ) { 
                     ONCE log() << "warning virtual/mapped memory differential is large. journaling:" << cmdLine.dur << endl;
                 }
                 last = time(0);
                 mlast = m;
             }
         }
     }
     catch(...) {
         log() << "ProcessInfo exception" << endl;
     }
 }
开发者ID:jfensign,项目名称:mongo,代码行数:25,代码来源:clientcursor.cpp


注:本文中的ProcessInfo::getResidentSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。