Currently used memory

When I enter a room in my game, I preload all the sounds, and I unload them when leaving. In order to reduce preloading/unloading, I’d like to check how much memory FMOD is using to store the preloaded samples and act only after a certain memory threshold has been reached.

Is there any field I can check to know much memory FMOD is using on preload?

If not, is there any way (exact or approximate) to get the amount of memory an instance takes, so that I can keep the memory usage myself ?

Thanks!

You can record a profiler session using Live Update. The recorded session will contain all the CPU and memory information for each individual event, bus, and the project as a whole.

https://www.fmod.com/resources/documentation-studio?version=2.02&page=profiling.html

Hi Richard, thanks for your answer.

I meant to use in production, when the game is running in the player’s machine.

In that case, you would need to use the various functions of getCPUUsage and getMemoryUsage, depending on your needs.

https://www.fmod.com/resources/documentation-api?version=2.02&page=studio-api-bus.html#studio_bus_getcpuusage

https://www.fmod.com/resources/documentation-api?version=2.02&page=studio-api-bus.html#studio_bus_getmemoryusage

Hi Richard,

Unfortunately the memory usage function seems to work only with the logging version, but not with the Release version of the DLL :frowning:

I’ve been informed by our dev team that you could ship the game with the logging version of FMOD but disable the logging. That way you can have access to the CPU and Memory usage functions.

Hi Richard, thanks for your answer, that’s what I was searching for.

Just an additional question: How is the logging version performance compared to the release version? Is it significantly slower or they’re about the same? (specially on consoles)

I’ve just had the idea of creating a small database containing every fmod sound and its size beforehand (with the logging version) and then using that database with the release version of the DLL (memory usage should be about the same).

However if the logging version performance is about the same than the release performance, it doesn’t make sense doing that.

Thanks!

As long as logging and metering are disabled, it will run with the same performance as the release DLLs.

thanks!