由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - question on mem management
相关主题
Char x[] = "abc"; 是在heap还是stack上? (转载)How to know the linux is running on a virtual server?
问一个跟 memory (process address space) 的有关的问题ubuntu用着用着就没声音了。
Valgrind报uninitialized value was created by a heap allocation【请教】在家里用2个router上网(一前一后)的问题 (转载)
Catalyst driver 用不了了How to split sk_buf into 2 (转载)
奇怪的swap,一部分不见了 (转载)linux内存分配中page的几个问题 (转载)
ubuntu 8.10对video memory要求很高吗?请教VM中Ubuntu 12.04 LTS增大硬盘容量的正确步骤
用 ext4 又怕停电的,等2.6.30。。。。Amazon EC2 Q: what's the source ip for security group ? (转载)
求助,安装PERL 5.8.8 (www.cpan.org)到红帽AS4linux如何瘦身
相关话题的讨论汇总
话题: mem话题: kernel话题: blocks话题: management话题: block
进入Linux版参与讨论
1 (共1页)
c******n
发帖数: 4965
1
recently ran into some questions regarding what java is doing when its
starting virtual space is 2G, while running a no-op program.
then I dug into what happens when malloc() is called.
it looks malloc() has 2 mem management methods: it has its own cache of
memory blocks, using "buddy" algorithm, then for larger block requests, it
just mmaps() an anonymous block , **** essentially delegating the task to
kernel mem management *****
then my question is , what happens to kernel when it tries to allocate a
block? it seems that it is never a problem when you request large blocks
that are bigger than several pages, right? ---- you don't have a problem
with finding continuous memory blocks, since all the pages are mapped by
page tables. kernel mem management is only concerned with managing requests
for small blocks (smaller than 1 page ) ???
thanks lot
l*****o
发帖数: 473
2
I am trying to answer your questions. However, it is involved in some
complicated mechanism which I can't explain easily.
what happens to kernel when it tries to allocate a
block?
--If you are asking for a block of physical memory, then kernel will
allocate it from its buddy manager.
it seems that it is never a problem when you request large blocks
that are bigger than several pages, right?
---Sure, kernel can allocate a large block, but maybe less than 1024 pages.
This mechanism may change with different kernel version.
you don't have a problem with finding continuous memory blocks, since all
the pages are mapped by page tables.
---yes, Normally user space program won't need continuous physical memory at
all. Only those related to hardware will need it.
kernel mem management is only concerned with managing requests
for small blocks (smaller than 1 page ) ???
---It depends. Those small blocks are managed by slab allocator. Kernel
surely need to manage those requests larger than 1 page.
1 (共1页)
进入Linux版参与讨论
相关主题
linux如何瘦身奇怪的swap,一部分不见了 (转载)
新手求教简单问题ubuntu 8.10对video memory要求很高吗?
linux kernel问题 (转载)用 ext4 又怕停电的,等2.6.30。。。。
howto install vboxguestadditions on CentOS.求助,安装PERL 5.8.8 (www.cpan.org)到红帽AS4
Char x[] = "abc"; 是在heap还是stack上? (转载)How to know the linux is running on a virtual server?
问一个跟 memory (process address space) 的有关的问题ubuntu用着用着就没声音了。
Valgrind报uninitialized value was created by a heap allocation【请教】在家里用2个router上网(一前一后)的问题 (转载)
Catalyst driver 用不了了How to split sk_buf into 2 (转载)
相关话题的讨论汇总
话题: mem话题: kernel话题: blocks话题: management话题: block