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

Ticket #518: some fixes for growing memory usage in PJSUA-LIB, by using temporary pools for temporary variables and by having separate pool for each account and buddy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c

    r2039 r2130  
    581581 
    582582    /* Create memory pool for application. */ 
    583     pjsua_var.pool = pjsua_pool_create("pjsua", 4000, 4000); 
     583    pjsua_var.pool = pjsua_pool_create("pjsua", 1000, 1000); 
    584584     
    585585    PJ_ASSERT_RETURN(pjsua_var.pool, PJ_ENOMEM); 
     
    10701070        pjsua_pres_shutdown(); 
    10711071 
    1072         /* Unregister, if required: */ 
     1072        /* Destroy pool in the buddy object */ 
     1073        for (i=0; i<(int)PJ_ARRAY_SIZE(pjsua_var.buddy); ++i) { 
     1074            if (pjsua_var.buddy[i].pool) { 
     1075                pj_pool_release(pjsua_var.buddy[i].pool); 
     1076                pjsua_var.buddy[i].pool = NULL; 
     1077            } 
     1078        } 
     1079 
     1080        /* Destroy accounts */ 
    10731081        for (i=0; i<(int)PJ_ARRAY_SIZE(pjsua_var.acc); ++i) { 
    10741082            if (!pjsua_var.acc[i].valid) 
     
    10771085            if (pjsua_var.acc[i].regc) { 
    10781086                pjsua_acc_set_registration(i, PJ_FALSE); 
     1087            } 
     1088 
     1089            if (pjsua_var.acc[i].pool) { 
     1090                pj_pool_release(pjsua_var.acc[i].pool); 
     1091                pjsua_var.acc[i].pool = NULL; 
    10791092            } 
    10801093        } 
Note: See TracChangeset for help on using the changeset viewer.