Re: memory alloc/free issue

bycn82 <[email protected]> Tue, 9 Dec 2014 16:51:41 +0800
Newsgroups gmane.os.dragonfly-bsd.kernel
Message-ID <CAC+JH2zkez9FhLXfc8VwyZ0EmW3GCvfx_XHdUv0D93HakVwR7Q@mail.gmail.com>
*I print the pointer after kmalloc and before kfree, I noticed that all the
memory has been released*.
*kmalloc and kfree with pointer values are appearing in pair.*

On Tue, Dec 9, 2014 at 4:44 PM, Sepherosa Ziehau <[email protected]>
wrote:

>
>
> On Tue, Dec 9, 2014 at 3:43 PM, bycn82 <[email protected]> wrote:
>
>>
>>
>> *Hi,*
>>
>>
>>
>>
>>
>>
>>
>>
>> *Yesterday,I was checking the memory "alloc/free" for ipfw2 basic module,
>> because I know that the memory is not controlling well, and I dont
>> understand the meaning of below two line.Dec  9 08:30:23 dfly kernel: ipfw2
>> module basic unloaded malloc_uninit: 96 bytes of 'IP_FW2_BASIC' still
>> allocated on cpu 4Dec  9 08:30:23 dfly kernel:Dec  9 08:30:23 dfly kernel:
>> IP firewall unloaded malloc_uninit: -96 bytes of 'IP_FW2_BASIC' still
>> allocated on cpu 4*
>>
>> *size 96, so it is the dyn_rule, and I noticed that the kfree for
>> dyn_rule was exists and it was triggered. but the message still there.*
>>
>>
>
> It means you didn't free all of the allocated memory before unload the
> module.
>
>
>
>>
>> *another thing is I met below. it is inside the kmalloc ?*
>>
>>
>>
>>
>>
>>
>>
>>
>> *Regards,*
>> *Bill Yuan*
>>
>
>
>
> --
> Tomorrow Will Never Die
>
Step977.png (image/png, 88.7 KB) - not displayed