Re: [ns] memory leak because of payload allocation
Get out of trouble. Use Valgrind. Sidney Doria UFCG / BRAZIL 2010/11/26 avinash chaurasia avinash.aviank2...@gmail.com: hello all, I have written following lines of code in UDP to transfer mien data over network, but when i run script it eats up all my 3gb memory and 5gb swap too with actual data of size around 16 mb. code in udp layer: *p-allocdata(len);* * **((PacketData*)(p-userdata()))-setData(readbuf);* Can anyone help me out, whats wrong with this approach. at the receiver side i am calling *free(p);* * * Thanks Avinash Kumar Chaurasia Department of Computer Science IIT Kanpur, India Thanks Avinash Kumar Chaurasia Department of Computer Science IIT Kanpur, India -- Sidney Doria Redes ad hoc móveis Doutorado em Computação UFCG Brasil Nessa jornada, o conhecimento será o seu escudo... (Mestre dos Magos no episódio do grimoire de ouro)
Re: [ns] memory leak because of payload allocation
thanks, i will try that. But still i need to clarify one thing Is it wrong to allocate PacketData in UDP layer using following command *PacketData *pd=new PacketData(1000); packet-setdata(pd);* if it is wrong then how user send his own data from sender side to receiver side. I searched alot but didn't get much on this. Thanks in advance. Thanks Avinash Kumar Chaurasia Department of Computer Science IIT Kanpur, India On Fri, Nov 26, 2010 at 9:49 PM, Sidney Doria ssdo...@gmail.com wrote: Get out of trouble. Use Valgrind. Sidney Doria UFCG / BRAZIL 2010/11/26 avinash chaurasia avinash.aviank2...@gmail.com: hello all, I have written following lines of code in UDP to transfer mien data over network, but when i run script it eats up all my 3gb memory and 5gb swap too with actual data of size around 16 mb. code in udp layer: *p-allocdata(len);* * **((PacketData*)(p-userdata()))-setData(readbuf);* Can anyone help me out, whats wrong with this approach. at the receiver side i am calling *free(p);* * * Thanks Avinash Kumar Chaurasia Department of Computer Science IIT Kanpur, India Thanks Avinash Kumar Chaurasia Department of Computer Science IIT Kanpur, India -- Sidney Doria Redes ad hoc móveis Doutorado em Computação UFCG Brasil Nessa jornada, o conhecimento será o seu escudo... (Mestre dos Magos no episódio do grimoire de ouro)
[ns] memory leak because of payload allocation
hello all, I have written following lines of code in UDP to transfer mien data over network, but when i run script it eats up all my 3gb memory and 5gb swap too with actual data of size around 16 mb. code in udp layer: *p-allocdata(len);* * **((PacketData*)(p-userdata()))-setData(readbuf);* Can anyone help me out, whats wrong with this approach. at the receiver side i am calling *free(p);* * * Thanks Avinash Kumar Chaurasia Department of Computer Science IIT Kanpur, India Thanks Avinash Kumar Chaurasia Department of Computer Science IIT Kanpur, India