I had read a topic by Gabriele Tolomei about map of Linux memory. I want to make a memory map for my Linux Ubuntu 16.04, using basic utilities, like dd and xxd, and I want to compare my result with result from topic.

I have dump of Linux Swap Partition after system goes to hibernation. Also I have all information from /proc and /sys directories. How can I do something like this?

  • This may help: stackoverflow.com/a/1401595/2954288, alas you would need to get the map for each process individually and assemble the result. – Harald Jun 17 '17 at 15:25
  • @Harald, I agree with You, but not at all. I want to get full map of memory, not only map of process's memory. In /proc/ID/maps, we can't see Kernel memory. – KupuJIJI Jun 17 '17 at 15:47
  • 2
    Have a look at /proc/iomem and /proc/vmallocinfo, but I'm not sure if these are the complete mappings. BTW, the "this" link you gave points to the virtual memory view of a single process, not all mappings from virtual to physical memory (what you seem to be asking about). And swap space may use a totally different addressing scheme. – dirkt Jun 18 '17 at 13:16
  • @dirkt Yes, this way is much better. Several days ago I done that and I can tell that /proc/iomem use the same address space as swap, except adress space for block devices. For example, /proc/iomem has 9.25Gb in space, but RAM is only 8Gb – KupuJIJI Jun 23 '17 at 8:02
  • Huh? /proc/iomem mainly lists the memory mapped I/O devices (with some physical RAM thrown in between), so of course the total size of all areas will be more than physical RAM. You can have any amount of swap space (none, less than your RAM, more than your RAM). The whole point of having swap is to allow your processes to use more memory than available physical RAM (much more memory on early systems). So the OS is free to use whatever address scheme for swap space it likes. – dirkt Jun 23 '17 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.