No Memory Usage Tracking (2.01.12, UE4.27)

Hi,

I’m not sure if profiling tool works with consoles, so I decided to put on game’s screen information about CPU and Memory usage.
I managed to get CPU data, but it displays zeros in Memory data. I turned on Enable Memory Tracking in Project Settings → Plugins → FMOD Studio, but it still doesn’t do anything.
This is what I do:

FMOD_STUDIO_CPU_USAGE CPUUsage;
FMOD_STUDIO_MEMORY_USAGE MemoryUsage;
FMOD::Studio::System* StudioSystem = IFMODStudioModule::Get().GetStudioSystem(EFMODSystemContext::Runtime);
FMOD_RESULT Result = StudioSystem->getCPUUsage(&CPUUsage);
if (Result == FMOD_RESULT::FMOD_OK)
{
	Result = StudioSystem->getMemoryUsage(&MemoryUsage);
	if (Result == FMOD_RESULT::FMOD_OK)
	{
		FString String = FString::Printf(TEXT("FMOD CPU:\n- dsp: %f\n- stream: %f\n- geometry: %f\n- coreupdate: %f\n- studioupdate: "
											  "%f\nFMOD MEMORY:\n- exclusive: %f\n- inclusive: %f\n- sampledata: %f"),
			CPUUsage.dspusage,
			CPUUsage.streamusage,
			CPUUsage.geometryusage,
			CPUUsage.updateusage,
			CPUUsage.studiousage,
			MemoryUsage.exclusive,
			MemoryUsage.inclusive,
			MemoryUsage.sampledata);
		GEngine->AddOnScreenDebugMessage(-1, DeltaTime, FColor::FromHex("#FFC0CB"), String);
	}
}

Any idea what I might be doing wrong?

The FMOD Profiler does work on consoles, it should be enabled by default in the FMOD plugin settitngs in Unreal.
The fields in FMOD_STUDIO_MEMORY_USAGE are ints, not floats, so this is just a formatting error. Try this:

	"%f\nFMOD MEMORY:\n- exclusive: %d\n- inclusive: %d\n- sampledata: %d"),

Oh my gosh, how couldn’t I see that? I feel so stupid.
Thanks a lot, sorry for wasting your time.

1 Like