RudjiGames / MTuner

MTuner is a C/C++ memory profiler and memory leak finder for Windows, PlayStation 4 and 3, Android and other platforms
BSD 2-Clause "Simplified" License
2.63k stars 145 forks source link

Mtuner memory usage different with system #87

Closed yuanyazhen closed 1 year ago

yuanyazhen commented 1 year ago

I intend to use Mtuner to profile my application so that I can find the memory usage of the different modules (dll).

But I have found that Mtuner gives merely 512MB usage, while my application use over 10GB . image

Is there something wrong?

milostosic commented 1 year ago

It depends what you mean by 'my application use over 10GB'. If you allocate 10GB and MTuner is not catching that, I'm curious to hear more.

yuanyazhen commented 1 year ago

It's a game engine, that handles tens of gigabytes of assets. So definitely more than 512MB.

milostosic commented 1 year ago

How are you performing the capture? Try to provide as much details as possible, how you allocate memory, how you use MTuner do perform the capture, etc.

yuanyazhen commented 1 year ago

image image image We integrate quite lot of modules, for engine core, we use mi-malloc, we also use scripts like lua and javascripts.

milostosic commented 1 year ago

Without access to your code I can only give suggestions as I don't know how your engine manages memory and what all those script language runtimes are doing to allocate memory.

MTuner will show only heap memory intercepted through VirtualAlloc (check MTuner SDK code), using the profiling method you use. Any other memory is unaccounted for: binaries, data segment, etc. So you can either figure out what module in your engine is responsible and why would it not be intercepted... or use manual instrumentation through MTuner SDK. Can't help beyond this.

yuanyazhen commented 1 year ago

OK, I will look into the MTuner SDK code. Thank you