What is the command for dumping memory segment information in Unix/Linux?

  • Thread starter Thread starter waht
  • Start date Start date
  • Tags Tags
    Map Memory
Click For Summary
SUMMARY

The command for dumping memory segment information in Unix/Linux can be achieved using the pmap utility, which reports the memory usage of a specified process. The discussion highlights a memory segment dump example, showcasing various permissions and memory addresses associated with libraries such as libc-2.9.so and libgcc_s.so.1. Users are encouraged to explore commands that allow for targeted memory segment dumps by specifying start and stop addresses to differentiate between heap and stack segments.

PREREQUISITES
  • Understanding of Unix/Linux command line operations
  • Familiarity with memory management concepts in operating systems
  • Knowledge of shared libraries and their role in memory allocation
  • Basic proficiency with the pmap command
NEXT STEPS
  • Research the pmap command and its options for detailed memory usage analysis
  • Learn how to use gdb for debugging and inspecting memory segments
  • Explore memory management techniques in Unix/Linux, focusing on heap and stack differentiation
  • Investigate the cat /proc/[pid]/maps command for viewing memory mappings of processes
USEFUL FOR

System administrators, developers debugging memory issues, and anyone interested in optimizing memory usage in Unix/Linux environments will benefit from this discussion.

waht
Messages
1,502
Reaction score
4
Here is a small segment that was dumped after an error in a program has occurred - that does a lot of memory allocation.
Code:
b7ee6000-b7ee7000 rw-p 00157000 08:02 72280      /lib/libc-2.9.so             
b7ee7000-b7eea000 rw-p b7ee7000 00:00 0                                       
b7eea000-b7ef7000 r-xp 00000000 08:02 72115      /lib/libgcc_s.so.1           
b7ef7000-b7ef8000 r--p 0000c000 08:02 72115      /lib/libgcc_s.so.1           
b7ef8000-b7ef9000 rw-p 0000d000 08:02 72115      /lib/libgcc_s.so.1           
b7ef9000-b7f20000 r-xp 00000000 08:02 72284      /lib/libm-2.9.so             
b7f20000-b7f21000 r--p 00026000 08:02 72284      /lib/libm-2.9.so             
b7f21000-b7f22000 rw-p 00027000 08:02 72284      /lib/libm-2.9.so

Interestingly, it shows the privileges of different memory segments. I'm wondering if there is a command that dumps this kind information if you provide the start and stop memory address. Or to find out which segments are from the heap, or stack.
 
Technology news on Phys.org
pmap will report the memory usage of a process
 
thanks, it works
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
23
Views
6K