summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsip/sip_config.h
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-07-13 13:12:36 +0000
committerBenny Prijono <bennylp@teluu.com>2008-07-13 13:12:36 +0000
commit0d89432ea61bea6901abc6a34dbb9a20172f75ab (patch)
tree87e5e668f3076abbcd255ad55ebc7cf49fc034e4 /pjsip/include/pjsip/sip_config.h
parent003ffd64e31edf3dc3e087e51a6ce33228563386 (diff)
Ticket #564: Reduce the memory usage for default pjsip settings
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2131 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsip/sip_config.h')
-rw-r--r--pjsip/include/pjsip/sip_config.h32
1 files changed, 22 insertions, 10 deletions
diff --git a/pjsip/include/pjsip/sip_config.h b/pjsip/include/pjsip/sip_config.h
index d16245bf..34cae270 100644
--- a/pjsip/include/pjsip/sip_config.h
+++ b/pjsip/include/pjsip/sip_config.h
@@ -157,18 +157,24 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void)
/**
* Specify maximum transaction count in transaction hash table.
- * Default value is 16*1024
+ * For efficiency, the value should be 2^n-1 since it will be
+ * rounded up to 2^n.
+ *
+ * Default value is 1023
*/
#ifndef PJSIP_MAX_TSX_COUNT
-# define PJSIP_MAX_TSX_COUNT (16*1024)
+# define PJSIP_MAX_TSX_COUNT (1024-1)
#endif
/**
* Specify maximum number of dialogs in the dialog hash table.
- * Default value is 16*1024.
+ * For efficiency, the value should be 2^n-1 since it will be
+ * rounded up to 2^n.
+ *
+ * Default value is 511.
*/
#ifndef PJSIP_MAX_DIALOG_COUNT
-# define PJSIP_MAX_DIALOG_COUNT (16*1024)
+# define PJSIP_MAX_DIALOG_COUNT (512-1)
#endif
@@ -553,14 +559,14 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void)
* Initial memory size for UA layer
*/
#ifndef PJSIP_POOL_LEN_UA
-# define PJSIP_POOL_LEN_UA 4000
+# define PJSIP_POOL_LEN_UA 512
#endif
/**
* Memory increment for UA layer.
*/
#ifndef PJSIP_POOL_INC_UA
-# define PJSIP_POOL_INC_UA 4000
+# define PJSIP_POOL_INC_UA 512
#endif
#define PJSIP_MAX_FORWARDS_VALUE 70
@@ -571,17 +577,23 @@ PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void)
/* Transaction related constants. */
/**
- * Initial memory size for transaction layer
+ * Initial memory size for transaction layer. The bulk of pool usage
+ * for transaction layer will be used to create the hash table, so
+ * setting this value too high will not help too much with reducing
+ * fragmentation and the memory will most likely be wasted.
*/
#ifndef PJSIP_POOL_TSX_LAYER_LEN
-# define PJSIP_POOL_TSX_LAYER_LEN 4000
+# define PJSIP_POOL_TSX_LAYER_LEN 512
#endif
/**
- * Memory increment for transaction layer.
+ * Memory increment for transaction layer. The bulk of pool usage
+ * for transaction layer will be used to create the hash table, so
+ * setting this value too high will not help too much with reducing
+ * fragmentation and the memory will most likely be wasted.
*/
#ifndef PJSIP_POOL_TSX_LAYER_INC
-# define PJSIP_POOL_TSX_LAYER_INC 4000
+# define PJSIP_POOL_TSX_LAYER_INC 512
#endif
/**