Kokomelom
Kokomelom

Reputation: 353

Analyze Glibc heap memory

I research an embedded device that use GLIBC 2.25.

When I look at /proc/PID/maps I see under the heap section some anonymous sections ,I understand that sections create when the process use new

I dump those sections with dd and there is there interesting value that I want to understand is that buffer allocated or free, and what is the size of this buffer.

How can I do that please?

Upvotes: 2

Views: 513

Answers (1)

Yogesh Dhawale
Yogesh Dhawale

Reputation: 58

Instead of analyzing the memory from proc, you may want to try following options, limited to your env.

  1. use tools like valgrind if you suspect any kind of leaks or invalid read/writes.
  2. rather than looking at output of dd, attach to running process and inspect memory within process, gives you context to make sense of memory usage.
  3. use logging to dump addresses of allocation/free/read/write. This allows you to build better understanding of memory usage.

You may have to use all of the above options depending upon the complexity of your task.

Upvotes: 0

Related Questions