Drop-in replacement for UNiagaraDataInterfaceGeometryCollection that fixes per-frame heap memory leaks when used with GPU Niagara emitters. Temporary workaround until Epic ships an engine fix.
This bug has been submitted to Epic Games: Case#23920065
The engine's Geometry Collection Data Interface (ChaosNiagara plugin) leaks heap memory every frame when used with GPU emitters. The root cause is FNDIGeometryCollectionArrays being stored as a raw pointer that gets new'd each frame in ProvidePerInstanceDataForRenderThread but never freed when overwritten. Secondary leaks exist in Init() (no cleanup before reallocation) and at destruction (game-thread AssetArrays never freed).
The comparable NiagaraDataInterfacePhysicsAsset avoids all of this by storing its equivalent arrays struct by value. This plugin does the same. See DESIGN_GeoCollectionNDI_MemLeakFix.md for full technical details.
- Compiles and runs on UE 5.6 and UE 5.7
- No engine modifications required
Note: When switching between engine versions or recompiling after a failed build, you may need to delete the Binaries and Intermediate folders inside the plugin's directory before it will successfully compile.
- Copy the
Plugins/GeoCollectionNDIFixfolder into your project'sPlugins/directory
(NOTE: If no Plugins folder already exists, you can add one in the Root folder/same one Content is in).
- Rebuild your project (or restart the editor and let it compile)
- Enable the GeoCollectionNDIFix plugin in Edit > Plugins if it isn't enabled automatically
- Open any Niagara system that uses the Geometry Collection Data Interface
- In the Parameters panel, find the parameter of type Geometry Collection
- Change its type to Geometry Collection (Fixed) (it sits right next to the original in the list)
- Configure the same properties you had before (Source Mode, Default Geometry Collection, Source Actor, etc.)
- All function names and signatures are identical -- you will just need to use the fixed versions.
When Epic fixes the engine DI:
- Swap each Geometry Collection (Fixed) back to Geometry Collection in your Niagara systems
- Disable or delete the plugin