JX-Master / LunaSDK

Luna SDK is a C++ software development framework for real-time rendering applications.
Other
124 stars 8 forks source link

Add memory usage profiling APIs. #26

Closed JX-Master closed 1 year ago

JX-Master commented 1 year ago

We need built-in a memory usage profiling tools that will show runtime memory usage for applications. The profiling APIs support three kinds of profiling:

  1. Scope-based profiling: the API behaves like begin_event/end_event for API, and will capture all memory allocations in the call stack between these two functions.
  2. Allocation-based profiling: Mask runtime allocated memory with a specific category, so that the system knows the usage for the memory.
  3. Manual: attach arbitrary memory to the specified category directly. This can also used to track external-allocated memory like video memory. The user should call add_memory/remove_memory manually on allocation and deallocation.
JX-Master commented 1 year ago

Implemented in #38 .