malt icon indicating copy to clipboard operation
malt copied to clipboard

"own" vs "total"

Open aulwes opened this issue 2 years ago • 1 comments

Hi,

I noticed there are 2 subkeys in the server code: "own" and "total" (in function getFlatProfile() of MaltProject.js). What is the difference between these 2 subkeys? which one is used for displaying allocations in webview? It looks like "own" is displayed in the "Memory usage on peak" section in the home page. But in the Sources page, if I select "Global peak" there, it seems to display "total" amounts instead of "own". Similarly, in the Calltree page, do the inclusive/exclusive values use "total" or "own"?

Thanks,Rob

aulwes avatar Nov 02 '23 14:11 aulwes

Hi Rob, sorry for the delay.

MALT tracks two sub-metric for every counter : owned & total as you noticed :

  • total : number of time malloc (free....) has been seen under this function (by looking in all call stacks, so accounting if called in child functions).
  • owned : number of time malloc (free) has been called exactly in this function.

Maybe I could have been better inspirated to reuse the naming of valgrind / kcachgrind : include (total) / self (owned).

If it is not clear enough feel free to say, it is nice to have the explanation somewhere which can be useful for possibly others too.

svalat avatar Nov 06 '23 14:11 svalat