WARNING: EditorPerProjectUserSettings.ini exceeds 1024 KB! (Current: 3701.95 KB)

Hello,

Our EditorPerProjectUserSettings.ini seems to be continually growing. Locally, my ini has reached over 20 000 lines. To provide some perspective, I have this workstation since only 6 months.

Some sections of the ini file grow each time we open an asset.

For example,

[DetailCategories] is reaching 13 000 lines,

[DetailPropertyExpansion] 2 800 lines,

[ModuleFileTracking] 1 800 lines,

[DetailCustomWidgetExpansion] 1 100 lines,

[AssetEditorToolkitTabLocation] 1 000 lines

By removing those sections, the ini is back to 140 KB.

I’m bringing this to your attention and recommand looking at the pertinence of keeping track of infinite amount of tab locations or which asset has displaied its DetailCategories.

Is this behavior expected?

Thank you

PM

Steps to Reproduce

This issue brings 10s latency when closing BP editor

Hi,

There is a JIRA for this issue (Opened since UE 4.26 -> UE-93120). Here the comment on the JIRA:

`[DetailCategories], [GameplayTagWidget] and a few others take up the majority of space in EditorPerProjectUserSettings.ini

There is no method of cleaning up entries for things that no longer exist.
There are 10k-500k entries that cause saving of the .ini to take 2000+ms.`I’ll link this ticket to the JIRA. In the meantime, manual cleaning will be required to erase old data that do not have value there.

Regards,

Patrick

Hello, I made 2 scripts about this problem.

The first runs in UGS and warns if the EditorPerProjectUserSettings.ini file exceeds a certain size:

`# Scripts/CheckProjectUserSettings.ps1

param (
[Parameter(Mandatory = $true)]
[string]$ProjectPath,
[Parameter(Mandatory = $false)]
[int]$MaxSizeKB = 1024
)

$iniPath = Join-Path $ProjectPath “Saved\Config\WindowsEditor\EditorPerProjectUserSettings.ini”

if (-not (Test-Path $iniPath))
{
Write-Host “File not found: $iniPath”
exit 0
}

$fileInfo = Get-Item $iniPath
$fileSizeKB = [math]::Round($fileInfo.Length / 1KB, 2)

if ($fileSizeKB -gt $MaxSizeKB)
{
Write-Warning “EditorPerProjectUserSettings.ini exceeds $MaxSizeKB KB! (Current: $fileSizeKB KB)”
Write-Warning “You can clean up and optimize the file by using the "Clean User Setting Ini” tool in UGS (located in the menu More… > Clean User Setting Ini)"
}`You need to add it to UGS using the Build/UnrealGameSync.ini file (in the Build or Sync section, depending on your preferences):

+Step=(UniqueId="01965f45-1e0e-78b0-9b83-7f2974839abd", Description="Check User Settings Ini Size", StatusText="Checking User Settings Ini File Size...", EstimatedDuration="1", Type="Other", FileName="$(ComSpec)", WorkingDir="", Arguments="/C powershell -ExecutionPolicy Bypass -file $(BranchDir)\\Scripts\\CheckProjectUserSettings.ps1 -ProjectPath $(ProjectDir)", bUseLogWindow="True", bNormalSync="True", bScheduledSync="True", bShowAsTool="False")

The second script cleans up the large, uncritical categories in the Ini file.

`# Scripts/CleanProjectUserSettings.ps1

param (
[Parameter(Mandatory = $true)]
[string]$ProjectPath
)

function Remove-IniSection
{
param (
[Parameter(Mandatory = $true)]
[string]$FilePath,

[Parameter(Mandatory = $true)]
[string]$SectionNames
)

if (-not (Test-Path $FilePath))
{
Write-Host “File not found: $FilePath”
return
}

$lines = Get-Content $FilePath -Raw | Out-String
$lines = $lines -split “r?n”
$outputLines = @()
$insideSection = $false
$currentSection = “”

foreach ($line in $lines)
{
if ($line -match ‘^[(.+)]$’)
{
$currentSection = $matches[1]
if ($SectionNames -contains $currentSection)
{
$insideSection = $true
continue
}
else
{
$insideSection = $false
}
}

if (-not $insideSection)
{
$outputLines += $line
}
}

[System.IO.File]::WriteAllLines($FilePath, $outputLines)
}

$iniPath = Join-Path $ProjectPath “Saved\Config\WindowsEditor\EditorPerProjectUserSettings.ini”
Remove-IniSection -FilePath $iniPath
-SectionNames @(
“DetailCategories”,
“DetailCustomWidgetExpansion”,
“DetailCategoriesAdvanced”,
“DetailPropertyExpansion”,
“DetailMultiObjectNodeExpansion”,
“AssetEditorToolkitTabLocation”
)`And to add it to UGS:

+Step=(UniqueId="01965f26-bfc1-7228-b7b2-2d2cfd4109b3", Description="Clean User Settings Ini", StatusText="Cleaning User Settings...", EstimatedDuration="1", Type="Other", FileName="$(ComSpec)", WorkingDir="", Arguments="/C powershell -ExecutionPolicy Bypass -file $(BranchDir)\\Scripts\\CleanProjectUserSettings.ps1 -ProjectPath $(ProjectDir)", bUseLogWindow="True", OrderIndex="170", bNormalSync="False", bScheduledSync="False", bShowAsTool="True")This script can then be executed manually from the “More…” tool menu in the UGS project toolbar. (More… > Clean User Settings Ini)

Thanks for sharing Yoann!