mercredi 27 mai 2020

How to estimate worst case memory usage?

My project includes around 50 files and are written with C++11 standards. Now its being migrated to use C++17 and one major change is to use polymorphic memory resource with a custom allocator. However, I need to first know the worst case heap memory usage in the current implementation to allocate memory size for the new pmr resource. I need to know all the heap allocations including:

  1. Default new allocator
  2. std::vector and other std containers that use default allocator which again use new
  3. Smart pointers (make_shared and similar)
  4. Any other

Is there an open source tool or library or technique to know the heap allocations in cycle?

Aucun commentaire:

Enregistrer un commentaire