memory alloc/free issue

bycn82 bycn82 at gmail.com
Tue Dec 9 01:50:42 PST 2014


*Thanks for your reply, and I think I found the reason.by reading the
comment inside the kern_slaballocate.c , I know that the memory has been
released.*





*but malloc/free are seperated into differnt modules,  memory allocated in
module A is released in module B. so when I unload module A, it said "1000
bytes" not release yet, and "-1000 bytes" when I unload module B. They are
positive and negative values. So will this become a problem because A
module release B module's memory? *

On Tue, Dec 9, 2014 at 4:51 PM, bycn82 <bycn82 at gmail.com> wrote:

> *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 <sepherosa at gmail.com>
> wrote:
>
>>
>>
>> On Tue, Dec 9, 2014 at 3:43 PM, bycn82 <bycn82 at gmail.com> 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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dragonflybsd.org/pipermail/kernel/attachments/20141209/ccc06968/attachment-0007.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Step977.png
Type: image/png
Size: 90878 bytes
Desc: not available
URL: <http://lists.dragonflybsd.org/pipermail/kernel/attachments/20141209/ccc06968/attachment-0007.png>


More information about the Kernel mailing list