=== modified file 'acinclude/os-deps.m4' --- acinclude/os-deps.m4 2013-10-04 12:15:52 +0000 +++ acinclude/os-deps.m4 2014-03-17 14:27:13 +0000 @@ -197,26 +197,6 @@ ]) -dnl checks that the system provides struct mallinfo and mallinfo.mxfast. -dnl AC_DEFINEs HAVE_STRUCT_MALLINFO and HAVE_STRUCT_MALLINFO_MXFAST if so - -AC_DEFUN([SQUID_HAVE_STRUCT_MALLINFO],[ -AC_CHECK_TYPE(struct mallinfo,AC_DEFINE(HAVE_STRUCT_MALLINFO,1,[The system provides struct mallinfo]),,[ -#if HAVE_SYS_TYPES_H -#include -#endif -#if HAVE_MALLOC_H -#include -#endif]) -AC_CHECK_MEMBERS([struct mallinfo.mxfast],,,[ -#if HAVE_SYS_TYPES_H -#include -#endif -#if HAVE_MALLOC_H -#include -#endif]) -]) - dnl check the default FD_SETSIZE size. dnl not cached, people are likely to tune this dnl defines DEFAULT_FD_SETSIZE === modified file 'configure.ac' --- configure.ac 2014-03-17 11:18:01 +0000 +++ configure.ac 2014-03-17 14:27:13 +0000 @@ -2295,8 +2295,6 @@ #endif ]) -SQUID_HAVE_STRUCT_MALLINFO - dnl Override rusage() detect on MinGW because is emulated in source code case "$squid_host_os" in mingw) @@ -2471,7 +2469,6 @@ AC_CHECK_LIB(gnumalloc, malloc) if test "x$ac_cv_lib_gnumalloc_malloc" = "xyes"; then AC_MSG_NOTICE([Disabling extended malloc functions when using bundled gnumalloc]) - ac_cv_func_mallinfo=no ac_cv_func_mallocblksize=no ac_cv_func_mallopt=no else @@ -2928,16 +2925,6 @@ esac fi -# Recommended by Balint Nagy Endre -case "$host" in - *-univel-sysv4.2MP) - if test `uname -v` = "2.03"; then - AC_MSG_NOTICE([disabling mallinfo for $host]) - ac_cv_func_mallinfo=no - fi - ;; -esac - dnl This has to be before AC_CHECK_FUNCS # Disable poll() on certain platforms. Override by setting ac_cv_func_poll # when running configure. @@ -2998,7 +2985,6 @@ htobe16 \ htole16 \ lrand48 \ - mallinfo \ mallocblksize \ mallopt \ memcpy \ === modified file 'src/mgr/InfoAction.cc' --- src/mgr/InfoAction.cc 2014-03-16 12:44:59 +0000 +++ src/mgr/InfoAction.cc 2014-03-17 14:27:13 +0000 @@ -86,29 +86,8 @@ #if HAVE_MSTATS && HAVE_GNUMALLOC_H ms_bytes_total += stats.ms_bytes_total; ms_bytes_free += stats.ms_bytes_free; -#elif HAVE_MALLINFO && HAVE_STRUCT_MALLINFO - mp_arena += stats.mp_arena; - mp_uordblks += stats.mp_uordblks; - mp_ordblks += stats.mp_ordblks; - mp_usmblks += stats.mp_usmblks; - mp_smblks += stats.mp_smblks; - mp_hblkhd += stats.mp_hblkhd; - mp_hblks += stats.mp_hblks; - mp_fsmblks += stats.mp_fsmblks; - mp_fordblks += stats.mp_fordblks; -#if HAVE_STRUCT_MALLINFO_MXFAST - mp_mxfast += stats.mp_mxfast; - mp_nlblks += stats.mp_nlblks; - mp_grain += stats.mp_grain; - mp_uordbytes += stats.mp_uordbytes; - mp_allocated += stats.mp_allocated; - mp_treeoverhead += stats.mp_treeoverhead; -#endif /* HAVE_STRUCT_MALLINFO_MXFAST */ -#endif /* HAVE_MALLINFO && HAVE_STRUCT_MALLINFO */ +#endif total_accounted += stats.total_accounted; -#if !(HAVE_MSTATS && HAVE_GNUMALLOC_H) && HAVE_MALLINFO && HAVE_STRUCT_MALLINFO - mem_pool_allocated += stats.mem_pool_allocated; -#endif gb_saved_count += stats.gb_saved_count; gb_freed_count += stats.gb_freed_count; max_fd += stats.max_fd; === modified file 'src/mgr/InfoAction.h' --- src/mgr/InfoAction.h 2014-03-16 12:44:59 +0000 +++ src/mgr/InfoAction.h 2014-03-17 14:27:13 +0000 @@ -73,29 +73,8 @@ #if HAVE_MSTATS && HAVE_GNUMALLOC_H double ms_bytes_total; double ms_bytes_free; -#elif HAVE_MALLINFO && HAVE_STRUCT_MALLINFO - double mp_arena; - double mp_uordblks; - double mp_ordblks; - double mp_usmblks; - double mp_smblks; - double mp_hblkhd; - double mp_hblks; - double mp_fsmblks; - double mp_fordblks; -#if HAVE_STRUCT_MALLINFO_MXFAST - double mp_mxfast; - double mp_nlblks; - double mp_grain; - double mp_uordbytes; - double mp_allocated; - double mp_treeoverhead; -#endif /* HAVE_STRUCT_MALLINFO_MXFAST */ -#endif /* HAVE_MALLINFO && HAVE_STRUCT_MALLINFO */ +#endif double total_accounted; -#if !(HAVE_MSTATS && HAVE_GNUMALLOC_H) && HAVE_MALLINFO && HAVE_STRUCT_MALLINFO - double mem_pool_allocated; -#endif double gb_saved_count; double gb_freed_count; double max_fd; === modified file 'src/stat.cc' --- src/stat.cc 2014-03-16 12:44:59 +0000 +++ src/stat.cc 2014-03-17 14:27:13 +0000 @@ -499,11 +499,7 @@ double cputime; double runtime; #if HAVE_MSTATS && HAVE_GNUMALLOC_H - struct mstats ms; -#elif HAVE_MALLINFO && HAVE_STRUCT_MALLINFO - - struct mallinfo mp; #endif runtime = tvSubDsec(squid_start, current_time); @@ -600,52 +596,13 @@ stats.ms_bytes_free = ms.bytes_free; -#elif HAVE_MALLINFO && HAVE_STRUCT_MALLINFO - - mp = mallinfo(); - - stats.mp_arena = mp.arena; - - stats.mp_uordblks = mp.uordblks; - stats.mp_ordblks = mp.ordblks; - - stats.mp_usmblks = mp.usmblks; - stats.mp_smblks = mp.smblks; - - stats.mp_hblkhd = mp.hblkhd; - stats.mp_hblks = mp.hblks; - - stats.mp_fsmblks = mp.fsmblks; - - stats.mp_fordblks = mp.fordblks; - -#if HAVE_STRUCT_MALLINFO_MXFAST - - stats.mp_mxfast = mp.mxfast; - - stats.mp_nlblks = mp.nlblks; - - stats.mp_grain = mp.grain; - - stats.mp_uordbytes = mp.uordbytes; - - stats.mp_allocated = mp.allocated; - - stats.mp_treeoverhead = mp.treeoverhead; - -#endif /* HAVE_STRUCT_MALLINFO_MXFAST */ -#endif /* HAVE_MALLINFO */ +#endif stats.total_accounted = statMemoryAccounted(); { MemPoolGlobalStats mp_stats; memPoolGetGlobalStats(&mp_stats); -#if !(HAVE_MSTATS && HAVE_GNUMALLOC_H) && HAVE_MALLINFO && HAVE_STRUCT_MALLINFO - - stats.mem_pool_allocated = mp_stats.TheMeter->alloc.level; -#endif - stats.gb_saved_count = mp_stats.TheMeter->gb_saved.count; stats.gb_freed_count = mp_stats.TheMeter->gb_freed.count; } @@ -825,92 +782,14 @@ stats.ms_bytes_free / 1024, Math::doublePercent(stats.ms_bytes_free, stats.ms_bytes_total)); -#elif HAVE_MALLINFO && HAVE_STRUCT_MALLINFO - - storeAppendPrintf(sentry, "Memory usage for %s via mallinfo():\n",APP_SHORTNAME); - - storeAppendPrintf(sentry, "\tTotal space in arena: %6.0f KB\n", - stats.mp_arena / 1024); - - storeAppendPrintf(sentry, "\tOrdinary blocks: %6.0f KB %6.0f blks\n", - stats.mp_uordblks / 1024, stats.mp_ordblks); - - storeAppendPrintf(sentry, "\tSmall blocks: %6.0f KB %6.0f blks\n", - stats.mp_usmblks / 1024, stats.mp_smblks); - - storeAppendPrintf(sentry, "\tHolding blocks: %6.0f KB %6.0f blks\n", - stats.mp_hblkhd / 1024, stats.mp_hblks); - - storeAppendPrintf(sentry, "\tFree Small blocks: %6.0f KB\n", - stats.mp_fsmblks / 1024); - - storeAppendPrintf(sentry, "\tFree Ordinary blocks: %6.0f KB\n", - stats.mp_fordblks / 1024); - - double t = stats.mp_fsmblks + stats.mp_fordblks; - - storeAppendPrintf(sentry, "\tTotal in use: %6.0f KB %.0f%%\n", - t / 1024, Math::doublePercent(t, stats.mp_arena + stats.mp_hblkhd)); - - t = stats.mp_fsmblks + stats.mp_fordblks; - - storeAppendPrintf(sentry, "\tTotal free: %6.0f KB %.0f%%\n", - t / 1024, Math::doublePercent(t, stats.mp_arena + stats.mp_hblkhd)); - - t = stats.mp_arena + stats.mp_hblkhd; - - storeAppendPrintf(sentry, "\tTotal size: %6.0f KB\n", - t / 1024); - -#if HAVE_STRUCT_MALLINFO_MXFAST - - storeAppendPrintf(sentry, "\tmax size of small blocks:\t%.0f\n", stats.mp_mxfast); - - storeAppendPrintf(sentry, "\tnumber of small blocks in a holding block:\t%.0f\n", - stats.mp_nlblks); - - storeAppendPrintf(sentry, "\tsmall block rounding factor:\t%.0f\n", stats.mp_grain); - - storeAppendPrintf(sentry, "\tspace (including overhead) allocated in ord. blks:\t%.0f\n" - ,stats.mp_uordbytes); - - storeAppendPrintf(sentry, "\tnumber of ordinary blocks allocated:\t%.0f\n", - stats.mp_allocated); - - storeAppendPrintf(sentry, "\tbytes used in maintaining the free tree:\t%.0f\n", - stats.mp_treeoverhead); - -#endif /* HAVE_STRUCT_MALLINFO_MXFAST */ -#endif /* HAVE_MALLINFO */ +#endif storeAppendPrintf(sentry, "Memory accounted for:\n"); - -#if !(HAVE_MSTATS && HAVE_GNUMALLOC_H) && HAVE_MALLINFO && HAVE_STRUCT_MALLINFO - - storeAppendPrintf(sentry, "\tTotal accounted: %6.0f KB %3.0f%%\n", - stats.total_accounted / 1024, Math::doublePercent(stats.total_accounted, t)); - -#else - storeAppendPrintf(sentry, "\tTotal accounted: %6.0f KB\n", stats.total_accounted / 1024); - -#endif { MemPoolGlobalStats mp_stats; memPoolGetGlobalStats(&mp_stats); -#if !(HAVE_MSTATS && HAVE_GNUMALLOC_H) && HAVE_MALLINFO && HAVE_STRUCT_MALLINFO - - storeAppendPrintf(sentry, "\tmemPool accounted: %6.0f KB %3.0f%%\n", - stats.mem_pool_allocated / 1024, - Math::doublePercent(stats.mem_pool_allocated, t)); - - const double iFree = max(0.0, t - stats.mem_pool_allocated); - storeAppendPrintf(sentry, "\tmemPool unaccounted: %6.0f KB %3.0f%%\n", - (t - stats.mem_pool_allocated) / 1024, - Math::doublePercent(iFree, t)); -#endif - storeAppendPrintf(sentry, "\tmemPoolAlloc calls: %9.0f\n", stats.gb_saved_count); storeAppendPrintf(sentry, "\tmemPoolFree calls: %9.0f\n", @@ -1450,9 +1329,6 @@ #if HAVE_MSTATS && HAVE_GNUMALLOC_H struct mstats ms = mstats(); i = ms.bytes_total; -#elif HAVE_MALLINFO && HAVE_STRUCT_MALLINFO - struct mallinfo mp = mallinfo(); - i = mp.arena; #endif if (Config.warnings.high_memory < i) debugs(18, DBG_CRITICAL, "WARNING: Memory usage at " << ((unsigned long int)(i >> 20)) << " MB"); === modified file 'src/tools.cc' --- src/tools.cc 2014-03-17 11:18:01 +0000 +++ src/tools.cc 2014-03-17 14:27:13 +0000 @@ -183,68 +183,7 @@ fprintf(debug_log, "\tTotal free: %6d KB %d%%\n", (int) (ms.bytes_free >> 10), Math::intPercent(ms.bytes_free, ms.bytes_total)); -#elif HAVE_MALLINFO && HAVE_STRUCT_MALLINFO - - struct mallinfo mp; - int t; - - if (!do_mallinfo) - return; - - mp = mallinfo(); - - fprintf(debug_log, "Memory usage for " APP_SHORTNAME " via mallinfo():\n"); - - fprintf(debug_log, "\ttotal space in arena: %6ld KB\n", - (long)mp.arena >> 10); - - fprintf(debug_log, "\tOrdinary blocks: %6ld KB %6ld blks\n", - (long)mp.uordblks >> 10, (long)mp.ordblks); - - fprintf(debug_log, "\tSmall blocks: %6ld KB %6ld blks\n", - (long)mp.usmblks >> 10, (long)mp.smblks); - - fprintf(debug_log, "\tHolding blocks: %6ld KB %6ld blks\n", - (long)mp.hblkhd >> 10, (long)mp.hblks); - - fprintf(debug_log, "\tFree Small blocks: %6ld KB\n", - (long)mp.fsmblks >> 10); - - fprintf(debug_log, "\tFree Ordinary blocks: %6ld KB\n", - (long)mp.fordblks >> 10); - - t = mp.uordblks + mp.usmblks + mp.hblkhd; - - fprintf(debug_log, "\tTotal in use: %6d KB %d%%\n", - t >> 10, Math::intPercent(t, mp.arena)); - - t = mp.fsmblks + mp.fordblks; - - fprintf(debug_log, "\tTotal free: %6d KB %d%%\n", - t >> 10, Math::intPercent(t, mp.arena)); - -#if HAVE_STRUCT_MALLINFO_MXFAST - - fprintf(debug_log, "\tmax size of small blocks:\t%d\n", - mp.mxfast); - - fprintf(debug_log, "\tnumber of small blocks in a holding block:\t%d\n", - mp.nlblks); - - fprintf(debug_log, "\tsmall block rounding factor:\t%d\n", - mp.grain); - - fprintf(debug_log, "\tspace (including overhead) allocated in ord. blks:\t%d\n", - mp.uordbytes); - - fprintf(debug_log, "\tnumber of ordinary blocks allocated:\t%d\n", - mp.allocated); - - fprintf(debug_log, "\tbytes used in maintaining the free tree:\t%d\n", - mp.treeoverhead); - -#endif /* HAVE_STRUCT_MALLINFO_MXFAST */ -#endif /* HAVE_MALLINFO */ +#endif } void