Skip to content

Commit

Permalink
HP_MALLOC: fix hp_status()
Browse files Browse the repository at this point in the history
    * Proper display of free fragment buckets on sig USR1/TERM/shutdown
    * some code refactoring

(cherry picked from commit 607fddd)
  • Loading branch information
liviuchircu committed Apr 1, 2015
1 parent 85ffd49 commit 91d155c
Show file tree
Hide file tree
Showing 5 changed files with 286 additions and 263 deletions.
22 changes: 0 additions & 22 deletions main.c
Expand Up @@ -339,19 +339,6 @@ unsigned int shm_secondary_hash_size = DEFAULT_SHM_SECONDARY_HASH_SIZE;
/* packaged memory (in MB) */
unsigned long pkg_mem_size=PKG_MEM_SIZE * 1024 * 1024;

/*
* adaptive image of OpenSIPS's memory usage during runtime
* used to fragment the shared memory pool at daemon startup
*/
char *mem_warming_pattern_file;
int mem_warming_enabled;

/*
* percentage of shared memory which will be fragmented at startup
* common values are between [0, 75]
*/
int mem_warming_percentage = -1;


/* export command-line to anywhere else */
int my_argc;
Expand Down Expand Up @@ -1448,17 +1435,8 @@ int main(int argc, char** argv)
return 0;
}


time(&startup_time);

if (mem_warming_enabled) {
if (!mem_warming_pattern_file)
mem_warming_pattern_file = MEM_WARMING_DEFAULT_PATTERN_FILE;

if (mem_warming_percentage == -1)
mem_warming_percentage = MEM_WARMING_DEFAULT_PERCENTAGE;
}

/*init shm mallocs
* this must be here
* -to allow setting shm mem size from the command line
Expand Down

0 comments on commit 91d155c

Please sign in to comment.