[AGENT++] how to release the content int table?

hyznull hyznull at hotmail.com
Tue Mar 26 02:48:17 CET 2013


Hi,Jochen
I have try MibTable::clear() or content.clearAll(),and it works.But the memory still keepin the program.The memory will not go down!When add new row into the content,the memorywill increase even double.At the end ,the system will restart.(my data is large)thanks.>Hi,

> hi. i have a problem in reset the content.i found the content.clear()
> cant not release the memory.myrun run server times ,i found my
> program have a memory leak in top.what shall i do to release the
> memory? in my code like this.is it right?
>void DynamicTable::reset()
>{
>    start_synch();
>    content.clear();
>    while(int i = 0;i < m_size;i++)
>    {
>        MibTableRow *r = new MibTableRow(generator);
>        r->set_index(my_index);
>        r->get_nth(leaf1)->replace_value(new Snmp_pp::OctetStr("abc"));
>        r->get_nth(leaf2)->replace_value(new Snmp_pp::OctetStr("abc"));
>        //.....
>        r->get_nth(leafn)->replace_value(new Snmp_pp::OctetStr("abc"));
>        content.add(r);
>    }
>    end_synch();
>}

>either use MibTable::clear() or content.clearAll().
>Regards,
>Jochen
 		 	   		  


More information about the AGENTPP mailing list