Hi All,
 
is there any limitation on the size of kamailo.cfg file. When i tried to add few avp_subst, then the kamailio starts showing up the error out of package memory on receiving SIP message. If i remove those lines then everything works fine.. avp_subst is simple one.  Our kamailio cfg file is quite big..
 
Please let me know how to debug this issue?
 
Here is the error
 2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [db_row.c:116]: no private memory left
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: db_postgres [km_res.c:293]: could not allocate row
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: db_postgres [km_res.c:258]: failed to convert row #1
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: db_postgres [km_res.c:75]: failed to convert rows
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: db_postgres [km_dbase.c:416]: error while converting result
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [db_query.c:137]: error while storing result
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: avpops [avpops_db.c:333]: cannot do the query
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: maxfwd [mf_funcs.c:62]: parsing MAX_FORWARD header failed!
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: rr [loose.c:98]: failed to parse headers
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: siputils [checks.c:64]: To parsing failed
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [action.c:831]: ERROR: do_action: memory allocation  failure
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [action.c:1511]: run action error at: :0
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: pv [pv_core.c:1761]: do action failed
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [lvalue.c:358]: setting pvar failed
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [parser/parse_from.c:71]: ERROR:parse_from_header: out of pkg_memory
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [route.c:1846]: ERROR: eval_elem: bad or missing From: header
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:02-05:00 [err] sipserver: ERROR: <core> [msg_translator.c:2229]: ERROR: build_res_buf_from_sip_req: alas, parse_headers failed
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:170]: get_hdr_field: out of memory
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: rr [loose.c:70]: failed to parse To header field
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:170]: get_hdr_field: out of memory
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: siputils [checks.c:64]: To parsing failed
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [action.c:831]: ERROR: do_action: memory allocation  failure
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [action.c:1511]: run action error at: :0
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:1740]: do action failed)
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [lvalue.c:358]: setting pvar failed
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:170]: get_hdr_field: out of memory
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:170]: get_hdr_field: out of memory
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:1381]: error parsing headers
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [data_lump.c:318]: ERROR: del_lump: out of memory
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: textops [textops.c:1081]: no memory
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/parse_from.c:71]: ERROR:parse_from_header: out of pkg_memory
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [route.c:1846]: ERROR: eval_elem: bad or missing From: header
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_svar.c:117]: out of pkg mem!
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:1640]: error - cannot set svar [backLinkMode]
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [lvalue.c:358]: setting pvar failed
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/parse_from.c:71]: ERROR:parse_from_header: out of pkg_memory
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:418]: cannot parse From header
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:400]: cannot parse To header
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_svar.c:117]: out of pkg mem!
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:1640]: error - cannot set svar [temp]
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [lvalue.c:358]: setting pvar failed
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_svar.c:117]: out of pkg mem!
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:1640]: error - cannot set svar [node]
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: osb [osb.c:916]: osb_set_var_char(): setting profile PV failed. value INVALID (char)
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_svar.c:117]: out of pkg mem!
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:1640]: error - cannot set svar [binding]
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: osb [osb.c:916]: osb_set_var_char(): setting profile PV failed. value INVALID (char)
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_shv.c:367]: no more pkg mem
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/parse_from.c:71]: ERROR:parse_from_header: out of pkg_memory
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:418]: cannot parse From header
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/msg_parser.c:342]: ERROR:parse_headers: memory allocation error
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:400]: cannot parse To header
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_svar.c:117]: out of pkg mem!
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:1640]: error - cannot set svar [temp]
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [lvalue.c:358]: setting pvar failed
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_svar.c:117]: out of pkg mem!
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:1640]: error - cannot set svar [node]
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: osb [osb.c:916]: osb_set_var_char(): setting profile PV failed. value INVALID (char)
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_svar.c:117]: out of pkg mem!
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:1640]: error - cannot set svar [binding]
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: osb [osb.c:916]: osb_set_var_char(): setting profile PV failed. value INVALID (char)
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <core> [parser/parse_from.c:71]: ERROR:parse_from_header: out of pkg_memory
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: pv [pv_core.c:418]: cannot parse From header
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: osb [osb.c:1257]: osb_get_osv_current_binding(): no binding available
2011-01-26T15:18:07-05:00 [err] sipserver: ERROR: <script>: R1 - binding IP=0 not available