Thanks. <br>But I think that command 'free' just tell the memory used in kernel space and user space.It is still unknown to us that how much memory is used by kernel.<br><br><br><br><div class="gmail_quote">On Fri, Nov 11, 2011 at 1:15 PM, Dave Stevens <span dir="ltr"><<a href="mailto:geek@uniserve.com">geek@uniserve.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">Quoting Geraint Yang <<a href="mailto:geraint0923@gmail.com" target="_blank">geraint0923@gmail.com</a>>:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Dave,<br>
Thank you for your help !<br>
Does it mean that I could use all of the memory my computer has? But one of<br>
my classmates told me that kernel could only use 1G from a 4G<br>
memory.computer...Is there anything I have misunderstood ?<br>
</blockquote>
<br></div>
I'm sitting in front of a Ubuntu box with 8G installed, uname -a shows:<br>
<br>
Linux roger-System-Product-Name 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux<br>
<br>
so kernel 3 and free: shows<br>
total used free shared buffers cached<br>
Mem: 8192500 2907656 5284844 0 162060 1915540<br>
-/+ buffers/cache: 830056 7362444<br>
Swap: 7812092 0 7812092<br>
<br>
so 2.9G of 8 in use<br>
<br>
Dave<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Fri, Nov 11, 2011 at 4:58 AM, Dave Hylands <<a href="mailto:dhylands@gmail.com" target="_blank">dhylands@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
On Thu, Nov 10, 2011 at 6:23 AM, Geraint Yang <<a href="mailto:geraint0923@gmail.com" target="_blank">geraint0923@gmail.com</a>><br>
wrote:<br>
> Hi there,<br>
> I am a newbie to Linux kernel programming. I am going to make a module<br>
> which will cost much memory in kernel, I just want to know how much<br>
> memory I can get by calling memory allocate API in kernel.<br>
<br>
All of it.<br>
<br>
>From kernel space, you can completely exhaust memory to the point of<br>
making your system unusable.<br>
<br>
>From kernel space you have vmalloc memory and kmalloc memory (plus a<br>
couple other memory spaces). Depending on how things are configured,<br>
it's possible to exhaust vmalloc memory even though there is memory<br>
available to be kmalloc'd.<br>
<br>
--<br>
Dave Hylands<br>
Shuswap, BC, Canada<br>
<a href="http://www.davehylands.com" target="_blank">http://www.davehylands.com</a><br>
<br>
</blockquote>
<br>
<br>
<br>
--<br>
Geraint Yang<br>
Tsinghua University Department of Computer Science and Technology<br>
<br>
</blockquote>
<br>
<br>
<br></div></div><span class="HOEnZb"><font color="#888888">
-- <br>
It is told that such are the aerodynamics and wing loading of the bumblebee that, in principle, it cannot fly...if all this be true...life among bumblebees must bear a remarkable resemblance to life in the United States.<br>
<br>
-- John Kenneth Galbraith, in American Capitalism: The Concept of Countervailing Power<br>
<br>
<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div style="text-align:left">Geraint Yang <br>Tsinghua University Department of Computer Science and Technology</div>
<div><br></div><br>