LLM.LLMHeaderMaxSize
LLM.LLMHeaderMaxSize
#Overview
name: LLM.LLMHeaderMaxSize
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
The maximum total number of characters allowed for all of the LLM titles
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of LLM.LLMHeaderMaxSize is to set the maximum total number of characters allowed for all of the LLM (Low-Level Memory Tracker) titles in Unreal Engine 5. This setting is primarily used by the Low-Level Memory Tracking system, which is part of the Core module in Unreal Engine.
The Unreal Engine subsystem that relies on this setting variable is the Low-Level Memory Tracker (LLM), which is part of the Core module. It’s used specifically in the CSV writing functionality of the LLM system.
The value of this variable is set through a console variable (CVar) named CVarLLMHeaderMaxSize. It’s defined in the LowLevelMemTracker.cpp file with a default value of 5000, or 500000 if LLM_ALLOW_ASSETS_TAGS is defined.
This variable interacts closely with its associated variable CVarLLMHeaderMaxSize, which is the actual console variable that stores and provides access to the value.
Developers must be aware that:
- This setting directly affects the maximum size of the LLM CSV header.
- If asset tags are allowed (LLM_ALLOW_ASSETS_TAGS is defined), the default value is much larger (500000) due to the potential for many auto-generated LLM titles.
- Exceeding this limit can lead to corrupted LLM CSV data.
Best practices when using this variable include:
- Monitor the size of your LLM titles, especially if you’re using asset tags.
- If you’re experiencing issues with LLM CSV data corruption, consider increasing this value.
- Be cautious about setting this value too high, as it could lead to excessive memory usage for the CSV header.
Regarding the associated variable CVarLLMHeaderMaxSize:
The purpose of CVarLLMHeaderMaxSize is to provide a console-accessible way to get and set the LLM.LLMHeaderMaxSize value at runtime.
This console variable is used in the Core module, specifically in the LowLevelMemTracker functionality.
The value of CVarLLMHeaderMaxSize is set when it’s defined, but it can be changed at runtime through the console.
It interacts directly with LLM.LLMHeaderMaxSize, effectively serving as the runtime representation of that setting.
Developers should be aware that:
- Changes to CVarLLMHeaderMaxSize will affect the behavior of the LLM CSV writing process.
- The value can be accessed from any thread using GetValueOnAnyThread().
Best practices for CVarLLMHeaderMaxSize include:
- Use GetValueOnAnyThread() when accessing the value, as it’s thread-safe.
- If you need to change this value at runtime, do so through the appropriate console commands.
- Be aware of the potential impact on memory usage and CSV data integrity when modifying this value.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/LowLevelMemTracker.cpp:952
Scope: file
Source code excerpt:
TAutoConsoleVariable<int32> CVarLLMHeaderMaxSize(
TEXT("LLM.LLMHeaderMaxSize"),
#if LLM_ALLOW_ASSETS_TAGS
500000, // When using asset tags, you will have MANY more LLM titles since so many are auto generated.
#else
5000,
#endif
TEXT("The maximum total number of characters allowed for all of the LLM titles")
#Associated Variable and Callsites
This variable is associated with another variable named CVarLLMHeaderMaxSize
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/LowLevelMemTracker.cpp:951
Scope: file
Source code excerpt:
);
TAutoConsoleVariable<int32> CVarLLMHeaderMaxSize(
TEXT("LLM.LLMHeaderMaxSize"),
#if LLM_ALLOW_ASSETS_TAGS
500000, // When using asset tags, you will have MANY more LLM titles since so many are auto generated.
#else
5000,
#endif
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/LowLevelMemTracker.cpp:6072
Scope (from outer to inner):
file
function bool FLLMCsvWriter::CreateArchive
Source code excerpt:
// Create space for column titles that are filled in as we get them.
Write(FString::ChrN(CVarLLMHeaderMaxSize.GetValueOnAnyThread(), ' '));
Write(TEXT("\n"));
return true;
}
bool FLLMCsvWriter::UpdateColumns(const FTrackerTagSizeMap& TagSizes)
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/LowLevelMemTracker.cpp:6132
Scope (from outer to inner):
file
function void FLLMCsvWriter::WriteHeader
Source code excerpt:
int64 ColumnTitleTotalSize = Archive->Tell();
if (ColumnTitleTotalSize >= CVarLLMHeaderMaxSize.GetValueOnAnyThread())
{
UE_LOG(LogHAL, Error,
TEXT("LLM column titles have overflowed, LLM CSM data will be corrupted. Increase CVarLLMHeaderMaxSize > %d"),
ColumnTitleTotalSize);
}