diff --git a/utils.c b/utils.c index 2a1fdb3f..e85291cf 100644 --- a/utils.c +++ b/utils.c @@ -1,11 +1,5 @@ #include "uwsgi.h" -#ifdef __APPLE__ -#include -#include -#endif - - extern struct uwsgi_server uwsgi; #ifdef __BIG_ENDIAN__ @@ -137,42 +131,3 @@ char * uwsgi_get_cwd() { return cwd; } - -uint64_t get_free_memory() { - - uint64_t freemem = 0 ; - -#ifdef __APPLE__ - vm_statistics_data_t page_info; - mach_msg_type_number_t count; - - count = HOST_VM_INFO_COUNT; - if (host_statistics (mach_host_self(), HOST_VM_INFO, (host_info_t)&page_info, &count) == KERN_SUCCESS){ - freemem += (page_info.inactive_count + page_info.free_count) * uwsgi.page_size ; - } - -#elif defined(__linux__) - /* sadly linux has no api for getting the current size of page cache. we need to parse /proc/meminfo */ - FILE *meminfo; - - meminfo = fopen("/proc/meminfo", "r"); - if (!meminfo) { - perror("fopen()"); - } - else { - - } -#elif defined(__FreeBSD__) - int value ; - size_t dlen; - - if (sysctlbyname("vm.stats.vm.v_free_count", &value, &dlen, NULL, 0) != 0) { - perror("sysctlbyname()"); - } - else { - freemem += value*uwsgi.page_size ; - } -#endif - - return freemem ; -} diff --git a/uwsgi.c b/uwsgi.c index d7356415..ae38cab7 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -964,8 +964,6 @@ int main(int argc, char *argv[], char *envp[]) { uwsgi.page_size = getpagesize(); fprintf(stderr,"your memory page size is %d bytes\n", uwsgi.page_size); - fprintf(stderr,"your system has %llu megabytes of free memory\n", get_free_memory()/1024/1024); - #ifndef UNBIT fprintf(stderr,"your server socket listen backlog is limited to %d connections\n", uwsgi.listen_queue); #endif @@ -1328,8 +1326,6 @@ int main(int argc, char *argv[], char *envp[]) { uwsgi.workers[0].current_workers = uwsgi.numproc ; - /* print memory usage after module initialization */ - fprintf(stderr,"you system has now %llu megabytes of free memory\n", get_free_memory()/1024/1024); if (!uwsgi.master_process && uwsgi.numproc == 1) { fprintf(stderr, "spawned uWSGI worker 1 (and the only) (pid: %d)\n", masterpid); diff --git a/uwsgi.h b/uwsgi.h index 40baec22..c8ac68fd 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -366,8 +366,6 @@ void init_uwsgi_module_sharedarea(PyObject *); void init_uwsgi_module_advanced(PyObject *); void init_uwsgi_module_spooler(PyObject *); -uint64_t get_free_memory(void); - #ifndef ROCK_SOLID int spool_request(char *, int, char *, int); void spooler(PyObject *);