2

I am developing an application which runs on a Linux environment. Inside /proc/<pid>/smaps, my process contains many anonymous mappings whose origin is unknown to me. It might be dynamically mapped by my code through malloc, or it might belong to one of the static or dynamic libraries that my application uses. There may be other sources of anonymous mappings that I am not aware of.

Is there a way to find which parts of my application are causing these anonymous mappings?

Moon_Raven
  • 309
  • 2
  • 12
  • [Some good reading here on that topic](https://stackoverflow.com/questions/4690800/how-to-profile-memory-usage) – ryyker Aug 24 '21 at 20:02
  • Is it possible to get at least a subset of such information without runtime profiling? – Moon_Raven Aug 24 '21 at 20:10
  • Well, if possible, edit your post to include those things you have tried so far. Maybe one of those efforts will spur off some more useful conversation... – ryyker Aug 24 '21 at 21:23
  • In the mean-time, good old fashioned research and inspection is all you have. eg., Run a dependencies check to see what and when your `application` and `shared libraries` use, and what those secondary `shared libraries` use, and so on. Read anything you can find on the architecture of the Linux version you are using. Understand how [garden variety dynamic memory is allocated](https://stackoverflow.com/questions/64029219/why-does-malloc-call-mmap-and-brk-interchangeably/64029494#64029494) and how it would affect your memory growth, and seem not to result in memory reduction,... – ryyker Aug 24 '21 at 21:26

0 Answers0