# Currently used memory

**URL:** <https://qa.fmod.com/t/currently-used-memory/17788>\
**Category:** FMOD Engine\
**Created:** [October 13, 2021, 8:57am UTC](https://qa.fmod.com/t/currently-used-memory/17788 "2021-10-13T08:57:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![KakCAT](https://avatars.discourse-cdn.com/v4/letter/k/a3d4f5/32.png) [@KakCAT](https://qa.fmod.com/u/KakCAT)\
**Post date:** [October 13, 2021, 8:57am UTC](https://qa.fmod.com/t/currently-used-memory/17788/1 "2021-10-13T08:57:12Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [October 15, 2021, 4:49am UTC](https://qa.fmod.com/t/currently-used-memory/17788/2 "2021-10-15T04:49:29Z")

</div>

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](https://www.fmod.com/resources/documentation-studio?version=2.02&page=profiling.html)

---

<div class="post-metadata">

**Author:** ![KakCAT](https://avatars.discourse-cdn.com/v4/letter/k/a3d4f5/32.png) [@KakCAT](https://qa.fmod.com/u/KakCAT)\
**Post date:** [October 15, 2021, 7:38am UTC](https://qa.fmod.com/t/currently-used-memory/17788/3 "2021-10-15T07:38:03Z")

</div>

Hi Richard, thanks for your answer.

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

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [October 18, 2021, 4:45am UTC](https://qa.fmod.com/t/currently-used-memory/17788/4 "2021-10-18T04:45:59Z")

</div>

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_getcpuusage)

[https://www.fmod.com/resources/documentation-api?version=2.02&page=studio-api-bus.html#studio\_bus\_getmemoryusage](https://www.fmod.com/resources/documentation-api?version=2.02&page=studio-api-bus.html#studio_bus_getmemoryusage)

---

<div class="post-metadata">

**Author:** ![KakCAT](https://avatars.discourse-cdn.com/v4/letter/k/a3d4f5/32.png) [@KakCAT](https://qa.fmod.com/u/KakCAT)\
**Post date:** [October 19, 2021, 9:24am UTC](https://qa.fmod.com/t/currently-used-memory/17788/5 "2021-10-19T09:24:44Z")

</div>

Hi Richard,

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

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [October 20, 2021, 5:13am UTC](https://qa.fmod.com/t/currently-used-memory/17788/6 "2021-10-20T05:13:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![KakCAT](https://avatars.discourse-cdn.com/v4/letter/k/a3d4f5/32.png) [@KakCAT](https://qa.fmod.com/u/KakCAT)\
**Post date:** [October 20, 2021, 8:24am UTC](https://qa.fmod.com/t/currently-used-memory/17788/7 "2021-10-20T08:24:06Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![richard\_simms](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/richard_simms/32/261_2.png) [@richard\_simms](https://qa.fmod.com/u/richard_simms)\
**Post date:** [October 20, 2021, 10:49pm UTC](https://qa.fmod.com/t/currently-used-memory/17788/8 "2021-10-20T22:49:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KakCAT](https://avatars.discourse-cdn.com/v4/letter/k/a3d4f5/32.png) [@KakCAT](https://qa.fmod.com/u/KakCAT)\
**Post date:** [October 21, 2021, 6:26pm UTC](https://qa.fmod.com/t/currently-used-memory/17788/9 "2021-10-21T18:26:51Z")

</div>

thanks!
