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

In summary, the conversation discusses a small segment of dumped data after an error in a program has occurred. It shows the memory allocation of different segments and mentions the possibility of using a command to gather this information based on specific memory addresses. The use of the pmap command to report memory usage of a process is also mentioned.
  • #1
waht
1,501
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
  • #2
pmap will report the memory usage of a process
 
  • #3
thanks, it works
 

What is the "memory map" command in Unix/Linux?

The "memory map" command in Unix/Linux is a tool that allows users to view the virtual memory map of a process. This map shows the virtual memory addresses and the corresponding memory permissions for each section of the process's memory.

How do I use the "memory map" command?

To use the "memory map" command, simply type "pmap" followed by the process ID (PID) of the process you want to view the memory map for. For example, "pmap 1234".

What information does the "memory map" command provide?

The "memory map" command provides information such as the virtual memory address, memory permissions, shared memory segments, and mapped files for each section of the process's memory.

Can I use the "memory map" command for all processes?

Yes, the "memory map" command can be used for all processes. However, you will need root/superuser privileges to view the memory map for processes that you do not own.

Why is the "memory map" command useful for debugging?

The "memory map" command is useful for debugging because it allows you to see how the memory is being used by a process. By examining the memory map, you can identify any potential issues such as memory leaks or conflicts with shared memory segments.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
Replies
23
Views
5K
Back
Top