[Click] memory leak on creating a new element

Qinghua Ye qye at trlabs.ca
Mon Oct 31 15:08:56 EST 2005


I checked my code this morning, but find a error in the first piece of
code. It has not correctly dealed with all the break cases, while one of
these cases result in leaving one packet unprocessed. That's the cause of
the memory leaking problem. Sorry for the misleading message.

Anyway, thanks for your reply.

Qinghua

> Hi Kevin,
>
> Yes, I agree with Bart -- please post both pieces of code.
>
> Eddie
>
>
> On Oct 28, 2005, at 2:34 PM, Qinghua(Kevin) Ye wrote:
>
>> Hi There,
>>
>> I encoutered a memory leak problem when I create a new element. The
>> elements
>> is simple pull processing mode. It pulls serveral packets from its
>> input
>> element, stores it in a packets array, and then allocates a new packet
>> according to the total length of the packets, copies the content of
>> these
>> packets into the new allocated packet and frees the old packets one
>> by one.
>> Tests shows that there is memory leak problem.
>>
>> However, if I pull one packet, copy the packet content, kill it,
>> then pull
>> another packet, iteratively, it works ok. Could anyone give some
>> explanation
>> of this scheme? Thanks.
>>
>> Regards,
>> Qinghua
>>
>>
>> _______________________________________________
>> click mailing list
>> click at amsterdam.lcs.mit.edu
>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>>
>
>



More information about the click mailing list