| 221 | |
| 222 | [[BR]] |
| 223 | |
| 224 | == Wait, There's More! == |
| 225 | |
| 226 | If memory constraint is really really tight, there is one more final optimization that we can do, i.e. '''disabling RTCP''', by declaring this macro in {{{config_site.h}}}: |
| 227 | |
| 228 | {{{ |
| 229 | #define PJMEDIA_ADVERTISE_RTCP 0 |
| 230 | }}} |
| 231 | |
| 232 | Since many ICE objects are duplicated across ICE components (RTCP is an ICE component), this could potentially lower the heap usage by half! |
| 233 | |
| 234 | While the library currently only provides RTCP for media statistics to assist troubleshooting, still it's quite useful sometimes. You will loose RTT and TX statistics if you disable RTCP (for TX stats, you could get it in the remote endpoint of course). The system designer would need to decide whether this is a feasible optimization. |
| 235 | |
| 236 | == Final Result == |
| 237 | |
| 238 | With RTCP '''turned off''', here are the final result: |
| 239 | |
| 240 | || || Used || Allocated || Utilization% || |
| 241 | ||1) App initialization, after TURN allocation ||11,264 ||13,184 ||85|| |
| 242 | ||2) After pjsua_start() ||14,216 ||16,768 ||85|| |
| 243 | ||3) Idle after initialization ||8,304 ||9,600 ||87|| |
| 244 | ||4) Right after making outgoing call ||12,800 ||14,464 ||88|| |
| 245 | ||5) After ICE negotiation is complete ||18,544 ||20,992 ||88|| |
| 246 | ||6) 1 minute into call ||13,136 ||14,720 ||89|| |
| 247 | |
| 248 | It does reduce the heap consumption by close to half in some checkpoints (e.g. when idling after initialization), and significantly reduce the usages on other checkpoints. |
| 249 | |
| 250 | |