[Replying only to coders list] On Mon, 7 Nov 2016 19:25:49 +0530 Soubhagya wrote: SP> I have some queries with respect to memory leak in inetCidrRouteTable while SP> continuous query to inetCidrRouteTable . SP> [...] SP> As part of my project, we have added a support for ipv6 route entry in SP> "add_ipv6_route_entries()" under inetCidrRouteTable_container_load().
So based on the examples you gave, you are writing your own implementation and not using the net-snmp code. Did you use the MfD template to generate your code? SP> here my question is where and how to free the newly allocated memory . The SP> reason why I am asking in this forum is whether to call release request or SP> need to check how can i use CONTAINER_FREE for this. This depends on the options you passed to mib2c when running the MfD template. SP> For reference pasting end part of my code snipet for both SP> inetCidrRouteTable_container_load() and add_ipv6_route_entries() SP> respectively. As you can see, rowreq_ctx is passed to CONTAINER_INSERT and SP> i hope it's being freed properly. But Inside add_ipv6_route_entries(), we SP> are again allocating memory for "rowreq_ctx" and again passing it to SP> CONTAINER_INSERT in same way. So here which one i need to take care of ?? Each route is its own row in the table, so obviously you need a rowreq_ctx for each. You need to release both (at the appropriate time). SP> Whether I need to free the container or need to release memory by calling SP> inetCidrRouteTable_release_rowreq_ctx().? Again, this depends on how the code was generated. Do you completely rebuild the cache every time *_container_load() is called, or do you keep it around and only add/change new/changed rows? Does your rowreq_ctx only contain basic types and/or arrays, or does it contain pointers to allocated memory? If you used the MfD template, there should be comments throughout the code to help you out. -- Robert ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders