Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

302
Views
Heap pages in /proc/<pid>/maps

I would like to write a program that could parse the output of /proc/<pid>/maps in order to classify them into different categories:

  • Image : the page is either a mapping of the binary or one of it's required libraries
  • Mapped file : the page maps a specific file like a font for example
  • Stack
  • Heap
  • Private data
  • Shareable

As you might have guessed, the main idea is to develop an equivalent of sysinternals's vmmap tool for Linux.

I'm using the pathname field to determine in which category a page could be associated with.

If pathname is the same path as /proc/<pid>/exe symlink, or if it is a dependency, therefore it goes to Image.

If pathname is a file and isn't part of the Image, then it is a Mapped File.

If pathname is matching a pattern like [stack:<tid>] or [heap], then the page is respectively a Stack or a Heap.

While I was looking for some information about /proc/<pid>/maps, I came accross this stackoverflow post missing-heap-section-in-proc-pid-maps , where I discovered that if you were calling malloc with the size parameter above a certain threshold, a private anonymous mapping was created instead of increasing the size of the Heap.

  1. How can I know if an anonymous mapping is an independant heap, or something else ?
  2. Should I treat all anonymous mapping as [heap] ? If not, how to classify them ?
  3. What page could fit into the Private Data, and Shareable categories ?

Thanks !

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!