开发者

This code will cause kernel level memory leaks, what is the difference between this and user land memory leaks

开发者 https://www.devze.com 2023-02-08 11:30 出处:网络
void foo() { char *var = kmalloc(1, GFP_KERNEL); return; } This code will cause kernel level memory leaks, what is the difference between this and user land memory leaks
void foo()
{
    char *var = kmalloc(1, GFP_KERNEL);
    return;
}

This code will cause kernel level memory leaks, what is the difference between this and user land memory leaks

This is a question from a interview today. I did bad about this开发者_如何学Go question.Can anyone give any thoughts?


Memory leaked in userspace is reclaimed at process termination, but memory leaked in kernel space cannot be reclaimed until the machine is rebooted.

0

精彩评论

暂无评论...
验证码 换一张
取 消