Evgeny Gagua 2 years ago
parent
commit
ae75a95451
  1. 6
      Projects/la_mojo/build
  2. 1
      Projects/watchDogDaemon/kernel.cpp
  3. 2
      Projects/watchDogDaemon/kernel.h
  4. 24
      lib/App/common/hardwareManager.cpp

6
Projects/la_mojo/build

@ -1,11 +1,11 @@
#! /bin/sh
#make clean -e "CFG=Debug"
#make -e "CFG=Debug" -j6
make clean -e "CFG=Debug"
make -e "CFG=Debug" -j6
#make clean -e "CFG=Debug86"
make -e "CFG=Debug86" -j4
#make -e "CFG=Debug86" -j4
#make clean -e "CFG=Release86"
#make -e "CFG=Release86" -j4

1
Projects/watchDogDaemon/kernel.cpp

@ -351,6 +351,7 @@ void SP_KERNEL::m_fThreadProc( void ){
shutdown( ClientSocket, 2 );
close( ClientSocket );
} else {
LOG("New Handler Created");
m_vWPV.push_back( tPRC );
};
} else {

2
Projects/watchDogDaemon/kernel.h

@ -7,7 +7,7 @@
class SP_KERNEL;
#define SW_DEFAULT_TIMEOUT 60000 // 60 seconds
#define SW_DEFAULT_TIMEOUT 180000 // 180 seconds
#define SW_TIMEOUT_PERCISION 100 // 0.1 second
#define INVALID_SOCKET -1

24
lib/App/common/hardwareManager.cpp

@ -361,7 +361,7 @@ bool hardwareManager::validate( void ){
//Mem Validator
if( m_nMemoryLimitHeapSize ) {
size_t memStat = getCurrentRSS();
#ifdef DEBUG
#ifdef DEBUG_EXTRA
char MEM_MSG[128];
sprintf( MEM_MSG, "MEM: %" PRIu64 " TARG: %" PRIu64, memStat, m_nMemoryLimitHeapSize );
LOG( MEM_MSG );
@ -1401,12 +1401,30 @@ bool hardwareManager::updateSysInfo( DBC_SYS_LOAD_INFO *ptr ){
ptr->cpu1 = SI.loads[0] * f_load;
ptr->cpu5 = SI.loads[1] * f_load;
ptr->cpu15 = SI.loads[2] * f_load;
ptr->T_MEM = SI.totalram;
ptr->C_MEM = SI.totalram - SI.freeram;
ptr->T_MEM = SI.totalram * SI.mem_unit;
ptr->C_MEM = ( SI.totalram - SI.freeram ) * SI.mem_unit;
ptr->mem = 100.0f * (float)ptr->C_MEM / (float)ptr->T_MEM;
#ifdef DEBUG_EXTRA
char tB[128];
sprintf( tB, "Total Mem: %" PRIu64 " Free: %" PRIu64 " Perc: %.2f", SI.totalram, SI.freeram, ptr->mem );
LOG( tB );
#endif
if ( ptr->mem > 80.0f ) {
LOG_ERROR( "Try to free some caches!" );
/*
To free pagecache:
# echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
# echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
# echo 3 > /proc/sys/vm/drop_caches
*/
system( "echo 3 > /proc/sys/vm/drop_caches" );
};
} else {
LOG_ERROR("Error while getting System Info!");
};

Loading…
Cancel
Save