Changeset 2131 for pjproject


Ignore:
Timestamp:
Jul 13, 2008 1:12:36 PM (16 years ago)
Author:
bennylp
Message:

Ticket #564: Reduce the memory usage for default pjsip settings

Location:
pjproject/trunk/pjsip
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_config.h

    r2039 r2131  
    158158/** 
    159159 * Specify maximum transaction count in transaction hash table. 
    160  * Default value is 16*1024 
     160 * For efficiency, the value should be 2^n-1 since it will be 
     161 * rounded up to 2^n. 
     162 * 
     163 * Default value is 1023 
    161164 */ 
    162165#ifndef PJSIP_MAX_TSX_COUNT 
    163 #   define PJSIP_MAX_TSX_COUNT          (16*1024) 
     166#   define PJSIP_MAX_TSX_COUNT          (1024-1) 
    164167#endif 
    165168 
    166169/** 
    167170 * Specify maximum number of dialogs in the dialog hash table. 
    168  * Default value is 16*1024. 
     171 * For efficiency, the value should be 2^n-1 since it will be 
     172 * rounded up to 2^n. 
     173 * 
     174 * Default value is 511. 
    169175 */ 
    170176#ifndef PJSIP_MAX_DIALOG_COUNT 
    171 #   define PJSIP_MAX_DIALOG_COUNT       (16*1024) 
     177#   define PJSIP_MAX_DIALOG_COUNT       (512-1) 
    172178#endif 
    173179 
     
    554560 */ 
    555561#ifndef PJSIP_POOL_LEN_UA 
    556 #   define PJSIP_POOL_LEN_UA            4000 
     562#   define PJSIP_POOL_LEN_UA            512 
    557563#endif 
    558564 
     
    561567 */ 
    562568#ifndef PJSIP_POOL_INC_UA 
    563 #   define PJSIP_POOL_INC_UA            4000 
     569#   define PJSIP_POOL_INC_UA            512 
    564570#endif 
    565571 
     
    572578 
    573579/** 
    574  * Initial memory size for transaction layer 
     580 * Initial memory size for transaction layer. The bulk of pool usage 
     581 * for transaction layer will be used to create the hash table, so  
     582 * setting this value too high will not help too much with reducing 
     583 * fragmentation and the memory will most likely be wasted. 
    575584 */ 
    576585#ifndef PJSIP_POOL_TSX_LAYER_LEN 
    577 #   define PJSIP_POOL_TSX_LAYER_LEN     4000 
    578 #endif 
    579  
    580 /** 
    581  * Memory increment for transaction layer. 
     586#   define PJSIP_POOL_TSX_LAYER_LEN     512 
     587#endif 
     588 
     589/** 
     590 * Memory increment for transaction layer. The bulk of pool usage 
     591 * for transaction layer will be used to create the hash table, so  
     592 * setting this value too high will not help too much with reducing 
     593 * fragmentation and the memory will most likely be wasted. 
    582594 */ 
    583595#ifndef PJSIP_POOL_TSX_LAYER_INC 
    584 #   define PJSIP_POOL_TSX_LAYER_INC     4000 
     596#   define PJSIP_POOL_TSX_LAYER_INC     512 
    585597#endif 
    586598 
  • pjproject/trunk/pjsip/src/pjsip-simple/evsub.c

    r2039 r2131  
    297297 
    298298    /* Create pool: */ 
    299     mod_evsub.pool = pjsip_endpt_create_pool(endpt, "evsub", 4000, 4000); 
     299    mod_evsub.pool = pjsip_endpt_create_pool(endpt, "evsub", 512, 512); 
    300300    if (!mod_evsub.pool) 
    301301        return PJ_ENOMEM; 
  • pjproject/trunk/pjsip/src/pjsip-simple/publishc.c

    r2108 r2131  
    120120                                       1, &pjsip_publish_method.name); 
    121121     */ 
     122    PJ_UNUSED_ARG(endpt); 
    122123    return PJ_SUCCESS; 
    123124} 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c

    r2039 r2131  
    3737 
    3838#define MAX_ASYNC_CNT   16 
    39 #define POOL_LIS_INIT   4000 
    40 #define POOL_LIS_INC    4001 
    41 #define POOL_TP_INIT    4000 
    42 #define POOL_TP_INC     4002 
     39#define POOL_LIS_INIT   512 
     40#define POOL_LIS_INC    512 
     41#define POOL_TP_INIT    512 
     42#define POOL_TP_INC     512 
    4343 
    4444struct tcp_listener; 
  • pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c

    r2094 r2131  
    6767 
    6868#define MAX_ASYNC_CNT   16 
    69 #define POOL_LIS_INIT   4000 
    70 #define POOL_LIS_INC    4001 
    71 #define POOL_TP_INIT    4000 
    72 #define POOL_TP_INC     4002 
     69#define POOL_LIS_INIT   512 
     70#define POOL_LIS_INC    512 
     71#define POOL_TP_INIT    512 
     72#define POOL_TP_INC     512 
    7373 
    7474 
Note: See TracChangeset for help on using the changeset viewer.