0

I need to get the size of the kernel and user space of my linux distribution. is there a command to get the size of the kernel and user space?

Thanks Thomas

Thomas
  • 21
  • 6
  • Duplicate : http://stackoverflow.com/questions/17444286/what-is-the-linux-command-line-to-check-kernel-space-and-user-space-memory-used – Suku Jul 02 '14 at 08:27
  • 1
    No I don't want to know the size of the USED memory. I want to know the general size. I have 4GB memory space and I want to know if this is splitted as usual in 3GB user space and 1Gb kernel space – Thomas Jul 02 '14 at 08:36
  • @Thomas: That's a tricky question, because **each application** has 3 GB userspace and yet with 10 applications you don't have 30 GB of userspace in your 4 GB. – MSalters Jul 02 '14 at 09:21
  • Also, with the [4G/4G](http://stackoverflow.com/questions/6947261/4gb-4gb-kernel-vm-split) patch, user space and kernel space don't need to divide the 4G anymore. – MSalters Jul 02 '14 at 09:23

2 Answers2

2

You are looking for the CONFIG_PAGE_OFFSET setting. I don't think it shows up anywhere except the kernel config file.

cnicutar
  • 178,505
  • 25
  • 365
  • 392
  • This is 0xC0000000. What does this mean exactly? – Thomas Jul 02 '14 at 08:46
  • @Thomas It means the kernel stuff starts at virtual address `0xC0000000` which is 3G in hex. Let me know if you find any way to get it from a running system, I bet it's burried somewhere in `/sys`. – cnicutar Jul 02 '14 at 08:48
0

You can check /proc/<pid>/maps. The stack probably will end at 0xC0000000, but it's possible that your userspace is partitioned differently. I don't think it's guaranteed that all userspaces are the same size.

Anything not listed in the map is available for the kernel. But keep in mind that these are virtual addresses in the process address space. As user pro

MSalters
  • 173,980
  • 10
  • 155
  • 350