Is there a way to accurately evaluate all the memory allocated by llvm::ExecutionEngine

Hi team,

Recently, I have developed a cache for LLVM functions that involves keeping multiple llvm::ExecutionEngine objects in memory. However, I am encountering difficulties in accurately evaluating the memory consumption of the llvm::ExecutionEngine object.

Currently, I am utilizing llvm::SectionMemoryManager to assess the memory usage of the llvm::ExecutionEngine. Unfortunately, the allocateCodeSection() and allocateDataSection() methods do not provide a comprehensive representation of the actual memory consumption. The reported values are considerably lower than the real memory usage.

I am currently using LLVM 5, and upon reviewing the latest documentation, I couldn’t find a more suitable solution for this issue. I would greatly appreciate any insights or suggestions from the community regarding this matter.

Thank you in advance for your assistance.

I am using llvm 5, however when I look up the latest document, it seems no better solution. Would be appreciate if anyone knows any solution about it? Thanks.