Description

FLowLevelMemTracker::GetTagAmountForTracker with CustomProjectTag returns 0 always.
Because of FLLMTracker::FLLMThreadState::GetFrameStatTotals don't amount to about CustomTags.

Following code will fix this issue

	// walk over the tags for this level
	for (uint32 TagIndex = 0; TagIndex < InStateCopy.TaggedAllocTags.Num(); TagIndex++)
	{
		int64 Tag = InStateCopy.TaggedAllocTags[TagIndex];
		int64 Amount = InStateCopy.TaggedAllocs[TagIndex];

		//---------------------
		// update csv
#if LLM_TRACK_PEAK_MEMORY
		int64 Peak = InStateCopy.TaggedAllocPeaks[TagIndex];
		InCsvWriter.AddStat(Tag, Amount, Peak);
#else
		InCsvWriter.AddStat(Tag, Amount);
#endif

		//---------------------
		// update the stats
		if (Tag >= (int64)LLM_TAG_COUNT)
		{
			IncMemoryStatByFName(TagToFName(Tag), Amount);
		}
		else if (Tag >= LLM_CUSTOM_TAG_START)
		{
			IncMemoryStatByFName(CustomTags[Tag - LLM_CUSTOM_TAG_START].StatName, int64(Amount));
			IncMemoryStatByFName(CustomTags[Tag - LLM_CUSTOM_TAG_START].SummaryStatName, int64(Amount));
// beginning of fix code
			OutEnumTagAmounts[Tag] += Amount;
// end of fix code
		}
		else
		{
			LLMCheck(Tag >= 0 && LLMGetTagName((ELLMTag)Tag) != nullptr);
			IncMemoryStatByFName(LLMGetTagStat((ELLMTag)Tag), int64(Amount));
			IncMemoryStatByFName(LLMGetTagStatGroup((ELLMTag)Tag), int64(Amount));
			OutEnumTagAmounts[Tag] += Amount;
		}
	}

Steps to Reproduce

1. open [Link Removed] with UE4.23
2. run standalone game with -LLM option
3. see debug strings on game screen

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-92848 in the post.

0
Login to Vote

Fixed
ComponentUE - Foundation - Core
Affects Versions4.23
Target Fix4.26
Fix Commit13275209
Main Commit13308998
CreatedMay 7, 2020
ResolvedMay 12, 2020
UpdatedJul 13, 2020
View Jira Issue