Description

This leak occurs in Test builds, but not in Development builds.

Updating InstancedStaticMesh with UpdateInstancedTransform every frame causes a memory leak.

 

This screenshot was taken using Mempro to track StaticMesh's memory. It can see that the leak is increasing. Another screenshot shows the increased diff CallTree. When KeyValueData is allocated, the create MeshDrawCommand appears to remain in the Test build instead of being discarded (Red boxes). In Development build, the command is destroyed by Release(). 

 

Steps to Reproduce
  1. Enable LLM in Test builds (change the following code).

・\Engine\Source\Runtime\Core\Public\Misc\Build.h

#elif UE_BUILD_TEST

 //...

#ifndef STATS
// #define STATS ((USE_MALLOC_PROFILER || FORCE_USE_STATS) && !ENABLE_STATNAMEDEVENTS)
#define STATS 1
#endif

 //...

#ifndef NO_LOGGING
// #define NO_LOGGING !USE_LOGGING_IN_SHIPPING
#define NO_LOGGING 1
#endif

・\Engine\Source\Runtime\Core\Public\HAL\LowLevelMemTracker.h

// #define ENABLE_LOW_LEVEL_MEM_TRACKER (!UE_BUILD_SHIPPING && (!UE_BUILD_TEST || ALLOW_LOW_LEVEL_MEM_TRACKER_IN_TEST) && PLATFORM_SUPPORTS_LLM && WITH_ENGINE && 1)
#define ENABLE_LOW_LEVEL_MEM_TRACKER (!UE_BUILD_SHIPPING && PLATFORM_SUPPORTS_LLM && WITH_ENGINE && 1)

2. Package repro project with a Win64/Test build.

3. Add launch argument "-llm"and launch the application.

4. Execute the console command "stat llmfull".
   Then, StaticMesh tag memory keeps increasing.

 

Have Comments or More Details?

There's no existing public thread on this issue, so head over toAnswerHub just mention UE-95599 in the post.

0
Login to Vote

Fixed
ComponentRendering
Affects Versions4.25
Target Fix4.25.3
Fix Commit13184755
CreatedJul 20, 2020
ResolvedJul 21, 2020
UpdatedJul 31, 2020