# \#garbage-collector

**URL:** https://forums.unrealengine.com/tag/garbage-collector/2052.md

[Latest](https://forums.unrealengine.com/latest.md) · [Categories](https://forums.unrealengine.com/categories.md) · [Tags](https://forums.unrealengine.com/tags.md)

---

## [UE 5.8 10X GC Purge Garbage Performance Regression from 5.7](https://forums.unrealengine.com/t/ue-5-8-10x-gc-purge-garbage-performance-regression-from-5-7/2742577)

<div class="topic-metadata">

**Author:** [@Mr.Vadam](https://forums.unrealengine.com/u/Mr.Vadam)\
**Replies:** 7\
**Last updated:** [November 4, 2026, 10:00pm UTC](https://forums.unrealengine.com/t/ue-5-8-10x-gc-purge-garbage-performance-regression-from-5-7/2742577 "2026-11-04T22:00:40Z")

</div>

Summary Hi, i recently updated project from 5.7.2 to 5.8.1 and upon testing discovered the GC Purge Garbage pass taking at least 10x more time compared to 5.7. I have then tested the same finding via two blank projects …

---

## [Changing a default subobject name in C++ class leads to UActorComponent being marked as PendingKill immediately after being instantiated when loading from .uasset, and is eventually reset to NULL by GC](https://forums.unrealengine.com/t/changing-a-default-subobject-name-in-c-class-leads-to-uactorcomponent-being-marked-as-pendingkill-immediately-after-being-instantiated-when-loading-from-uasset-and-is-eventually-reset-to-null-by-gc/480745)

<div class="topic-metadata">

**Author:** [@RocknRolla](https://forums.unrealengine.com/u/RocknRolla)\
**Replies:** 9\
**Last updated:** [August 19, 2026, 10:09am UTC](https://forums.unrealengine.com/t/changing-a-default-subobject-name-in-c-class-leads-to-uactorcomponent-being-marked-as-pendingkill-immediately-after-being-instantiated-when-loading-from-uasset-and-is-eventually-reset-to-null-by-gc/480745 "2026-08-19T10:09:29Z")

</div>

Short Description So, I’ve been investigating this bug for quite some time. I have also found several posts on UE forums on this issue. It affects several engine versions – I have personally reproduced it on 4.25.4 and 4…

---

## [How to dispose UObject after using it in the editor.](https://forums.unrealengine.com/t/how-to-dispose-uobject-after-using-it-in-the-editor/487923)

<div class="topic-metadata">

**Author:** [@xXUnreal34Xx](https://forums.unrealengine.com/u/xXUnreal34Xx)\
**Replies:** 1\
**Last updated:** [May 15, 2025, 8:10pm UTC](https://forums.unrealengine.com/t/how-to-dispose-uobject-after-using-it-in-the-editor/487923 "2025-05-15T20:10:48Z")

</div>

Hello guys, I’m experiencing a lot of issues with the UE4 memory management system. I have a couple of C++ scripts in my editor to process StaticMesh such as : Generating LODs, Collision testing and more. I’m processing…

---

## [Crash at FlushQueuedReferences when using Timer](https://forums.unrealengine.com/t/crash-at-flushqueuedreferences-when-using-timer/2446162)

<div class="topic-metadata">

**Author:** [@JulianPW](https://forums.unrealengine.com/u/JulianPW)\
**Replies:** 2\
**Last updated:** [April 8, 2025, 11:51am UTC](https://forums.unrealengine.com/t/crash-at-flushqueuedreferences-when-using-timer/2446162 "2025-04-08T11:51:58Z")

</div>

Hello, I am currently trying to figure out where the following crash comes from. LogThreadingWindows: Error: Runnable thread Background Worker #26 crashed. LogWindows: Error: === Critical error: === LogWindows: Error: …

---

## [Magical Garbage Collection gets invalid Array from ArrayPool and crashes](https://forums.unrealengine.com/t/magical-garbage-collection-gets-invalid-array-from-arraypool-and-crashes/379371)

<div class="topic-metadata">

**Author:** [@OgoxHammerschild](https://forums.unrealengine.com/u/OgoxHammerschild)\
**Replies:** 4\
**Last updated:** [March 18, 2025, 5:56am UTC](https://forums.unrealengine.com/t/magical-garbage-collection-gets-invalid-array-from-arraypool-and-crashes/379371 "2025-03-18T05:56:37Z")

</div>

Hi, Unreal is hitting a break point at FastReferenceCollector.h:290 but there is no error message and I dont know where to fix stuff. This is the snippet where it happens: else if (ReferenceInfo.Type == GCRT\_ArrayObjec…

---

## [Crash in EnvQuerySystem due to GC ](https://forums.unrealengine.com/t/crash-in-envquerysystem-due-to-gc/2300330)

<div class="topic-metadata">

**Author:** [@phil.wardlaw](https://forums.unrealengine.com/u/phil.wardlaw)\
**Replies:** 1\
**Last updated:** [January 24, 2025, 10:31am UTC](https://forums.unrealengine.com/t/crash-in-envquerysystem-due-to-gc/2300330 "2025-01-24T10:31:33Z")

</div>

I am getting the following crash Unhandled Exception: SIGSEGV: invalid attempt to read memory at address 0x00000001b70f04f8 \[22.28.19:118\]\[0066.02\]\[871\]LogCore: Fatal error! FEnvQueryInstance::ExecuteOneStep() @ EnvQu…

---

## [Garbage collection, creating UObject while collecting garbage is not allowed](https://forums.unrealengine.com/t/garbage-collection-creating-uobject-while-collecting-garbage-is-not-allowed/2051311)

<div class="topic-metadata">

**Author:** [@Elites94](https://forums.unrealengine.com/u/Elites94)\
**Replies:** 1\
**Last updated:** [October 4, 2024, 8:36am UTC](https://forums.unrealengine.com/t/garbage-collection-creating-uobject-while-collecting-garbage-is-not-allowed/2051311 "2024-10-04T08:36:32Z")

</div>

Hello, I have an issue with garbage collection and I would like to know how I can find what is causing that… I have a game server in 4.26, and the fatal error “Creating UObjects while Collecting Garbage is not allowed!…

---

## [How to close widgets completely using remove from parent.](https://forums.unrealengine.com/t/how-to-close-widgets-completely-using-remove-from-parent/2017795)

<div class="topic-metadata">

**Author:** [@Miboza](https://forums.unrealengine.com/u/Miboza)\
**Replies:** 1\
**Last updated:** [September 12, 2024, 11:38pm UTC](https://forums.unrealengine.com/t/how-to-close-widgets-completely-using-remove-from-parent/2017795 "2024-09-12T23:38:35Z")

</div>

Hello helping heroes, Im making a menu and closing widgets with remove from parent. But when I go back and forth a lot in my menu, it creates alot of pages and it never really closes them. They only go away when I op…

---

## [Will UClass Object be GC?](https://forums.unrealengine.com/t/will-uclass-object-be-gc/2007922)

<div class="topic-metadata">

**Author:** [@user\_26c4c94f4bfc5ec2ad831c0e160b3abebd1aea0ce84dd247069373](https://forums.unrealengine.com/u/user_26c4c94f4bfc5ec2ad831c0e160b3abebd1aea0ce84dd247069373)\
**Replies:** 0\
**Last updated:** [September 6, 2024, 8:35am UTC](https://forums.unrealengine.com/t/will-uclass-object-be-gc/2007922 "2024-09-06T08:35:23Z")

</div>

I wrote a TMap\<UClass\*, int32\>. But the key could be pointing to a UClass that is defined in a dynamicly loaded module. So if that module got unloaded, will that UClass\* become a dangling pointer? Or I can expect that on…

---

## [Widget component widget not garbage collected](https://forums.unrealengine.com/t/widget-component-widget-not-garbage-collected/408225)

<div class="topic-metadata">

**Author:** [@DekanTrue](https://forums.unrealengine.com/u/DekanTrue)\
**Replies:** 7\
**Last updated:** [June 13, 2024, 12:40pm UTC](https://forums.unrealengine.com/t/widget-component-widget-not-garbage-collected/408225 "2024-06-13T12:40:07Z")

</div>

If I add a widget component and then create a widget and set the widget in the component, then the widget is not garbage collected. Note: The bottom “add widget component” doesn’t have a widget class set.

---

## [How to Obtain More Detailed Debugging Information for Garbage Collection](https://forums.unrealengine.com/t/how-to-obtain-more-detailed-debugging-information-for-garbage-collection/1892584)

<div class="topic-metadata">

**Author:** [@OM\_Mehmet](https://forums.unrealengine.com/u/OM_Mehmet)\
**Replies:** 0\
**Last updated:** [June 6, 2024, 4:26pm UTC](https://forums.unrealengine.com/t/how-to-obtain-more-detailed-debugging-information-for-garbage-collection/1892584 "2024-06-06T16:26:46Z")

</div>

Hi everyone, I’m encountering an issue where my game crashes in the build version on the client side, but everything works fine on the server. This crash happens during garbage collection. Is there any way I can debug t…

---

## [Keeping track of what's loaded in memory?](https://forums.unrealengine.com/t/keeping-track-of-whats-loaded-in-memory/352154)

<div class="topic-metadata">

**Author:** [@MaxPower42](https://forums.unrealengine.com/u/MaxPower42)\
**Replies:** 1\
**Last updated:** [May 27, 2024, 11:09pm UTC](https://forums.unrealengine.com/t/keeping-track-of-whats-loaded-in-memory/352154 "2024-05-27T23:09:06Z")

</div>

Hi. This has been a pain for me from the start… Having worked with C++ almost exclusively, I am not really used to having a garbage collector and no control over the deletion of objects. I know exactly when I don’t need …

---

## [Assert fails on EndPlay after an Actor was Spawned](https://forums.unrealengine.com/t/assert-fails-on-endplay-after-an-actor-was-spawned/1768342)

<div class="topic-metadata">

**Author:** [@SSttuudd](https://forums.unrealengine.com/u/SSttuudd)\
**Replies:** 1\
**Last updated:** [March 24, 2024, 12:56pm UTC](https://forums.unrealengine.com/t/assert-fails-on-endplay-after-an-actor-was-spawned/1768342 "2024-03-24T12:56:15Z")

</div>

Hi Despite all my efforts I fail to figure out how to fix this. After using SpawnActor (in cpp or in blueprint), if I stop the game, this check fails: Ths actor is properly spawned with the correct class, I can see …

---

## [UPROPERTY is set to null by GC](https://forums.unrealengine.com/t/uproperty-is-set-to-null-by-gc/455464)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_8658d287](https://forums.unrealengine.com/u/anonymous_user_8658d287)\
**Replies:** 5\
**Last updated:** [January 11, 2024, 2:35am UTC](https://forums.unrealengine.com/t/uproperty-is-set-to-null-by-gc/455464 "2024-01-11T02:35:48Z")

</div>

Hi everyone, I am having a problem with a property that is set to null after constructor finishes. I have a variable of UAttributeSet in my character and it is created in my constructor. This is the code: AEdenValleyCh…

---

## [Does an owner of UPROPERTY member need to be also declared with UPROPERTY for garbage collector to work properly?](https://forums.unrealengine.com/t/does-an-owner-of-uproperty-member-need-to-be-also-declared-with-uproperty-for-garbage-collector-to-work-properly/1468196)

<div class="topic-metadata">

**Author:** [@hzn84](https://forums.unrealengine.com/u/hzn84)\
**Replies:** 1\
**Last updated:** [December 5, 2023, 9:21am UTC](https://forums.unrealengine.com/t/does-an-owner-of-uproperty-member-need-to-be-also-declared-with-uproperty-for-garbage-collector-to-work-properly/1468196 "2023-12-05T09:21:44Z")

</div>

What would happen if I would have situation like below: USTRUCT() struct FChild { GENERATED\_BODY() UPROPERTY() UObject\* MyObject; } UCLASS() class UParentClass: public UObject { GENERATED\_BODY() FChil…

---

## [Need help debugging access violation in Garbage Collection](https://forums.unrealengine.com/t/need-help-debugging-access-violation-in-garbage-collection/1232432)

<div class="topic-metadata">

**Author:** [@jawslouis](https://forums.unrealengine.com/u/jawslouis)\
**Replies:** 0\
**Last updated:** [July 18, 2023, 8:57am UTC](https://forums.unrealengine.com/t/need-help-debugging-access-violation-in-garbage-collection/1232432 "2023-07-18T08:57:16Z")

</div>

I’m running into a crash that I have trouble debugging. This is on UE 5.2. My game will be running fine for a few minutes in PIE, then crash. I assume this occurs when the GC is triggered, since the stacktrace (attached…

---

## [Problems with Garbage Collection in UMG Widget.](https://forums.unrealengine.com/t/problems-with-garbage-collection-in-umg-widget/451591)

<div class="topic-metadata">

**Author:** [@FinalSparkGames](https://forums.unrealengine.com/u/FinalSparkGames)\
**Replies:** 4\
**Last updated:** [June 8, 2023, 5:45am UTC](https://forums.unrealengine.com/t/problems-with-garbage-collection-in-umg-widget/451591 "2023-06-08T05:45:49Z")

</div>

I’m facing this error for a while now. I did not find anything helpful in the internet yet. Anyone has a solution for that? I have a native Widget Baseclass that is overriden with a blueprint class. I’m spawning it and…

---

## [How to make weak object pointer to UINTERFACE-derived class?](https://forums.unrealengine.com/t/how-to-make-weak-object-pointer-to-uinterface-derived-class/370581)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_f6ad20b4](https://forums.unrealengine.com/u/anonymous_user_f6ad20b4)\
**Replies:** 3\
**Last updated:** [June 15, 2022, 1:30am UTC](https://forums.unrealengine.com/t/how-to-make-weak-object-pointer-to-uinterface-derived-class/370581 "2022-06-15T01:30:56Z")

</div>

It is my impression that an array of GC-aware references to C++ implementations of an Unreal Interface class (declared with UINTERFACE, etc) can be made like so: UPROPERTY() TArray\<TScriptInterface\<ISomeUnrealInterface\>\>…

---

## [What can cause objects to break disregard for GC assumptions?](https://forums.unrealengine.com/t/what-can-cause-objects-to-break-disregard-for-gc-assumptions/444561)

<div class="topic-metadata">

**Author:** [@cpntylor](https://forums.unrealengine.com/u/cpntylor)\
**Replies:** 8\
**Last updated:** [August 23, 2021, 9:34pm UTC](https://forums.unrealengine.com/t/what-can-cause-objects-to-break-disregard-for-gc-assumptions/444561 "2021-08-23T21:34:37Z")

</div>

We’re seeing a strange issue with garbage collection that seems to have started when we upgraded to the 4.21 version of the engine. In C++ we are spawning and firing projectiles actors. The code doing this does not store…

---

## [Question about garbage collect and widgets](https://forums.unrealengine.com/t/question-about-garbage-collect-and-widgets/484702)

<div class="topic-metadata">

**Author:** [@BioMedKUL](https://forums.unrealengine.com/u/BioMedKUL)\
**Replies:** 2\
**Last updated:** [July 7, 2021, 9:34am UTC](https://forums.unrealengine.com/t/question-about-garbage-collect-and-widgets/484702 "2021-07-07T09:34:37Z")

</div>

Hi, I have a specific setup where an overview widget with 3 tabs dynamically creates widgets and adds them as a child to a vertical box inside the overview. Each tab contains a list of exercises (each exercise is genera…

---

## [How to debug memory usage/Garbage collector?](https://forums.unrealengine.com/t/how-to-debug-memory-usage-garbage-collector/484845)

<div class="topic-metadata">

**Author:** [@somawheels](https://forums.unrealengine.com/u/somawheels)\
**Replies:** 1\
**Last updated:** [June 13, 2021, 7:57pm UTC](https://forums.unrealengine.com/t/how-to-debug-memory-usage-garbage-collector/484845 "2021-06-13T19:57:25Z")

</div>

I am having an issue where data associated with actors does not disappear when the actors are destroyed. I Understand UObjects are supposed to be garbage collected when no references to them exist, however mine clearly …

---

## [Assertion Failed !IsGarbageCollecting()](https://forums.unrealengine.com/t/assertion-failed-isgarbagecollecting/481686)

<div class="topic-metadata">

**Author:** [@StuntThumper88](https://forums.unrealengine.com/u/StuntThumper88)\
**Replies:** 1\
**Last updated:** [May 21, 2021, 4:57pm UTC](https://forums.unrealengine.com/t/assertion-failed-isgarbagecollecting/481686 "2021-05-21T16:57:34Z")

</div>

I have a plugin that tries to create UObjects after a database request, but occasionally it crashes because its trying to make UResultRow (a UObject) while its garbage collecting? I’ve break pointed it and VS says I’m in…

---

## [Invalid Reference / GC Crash on Level Streaming](https://forums.unrealengine.com/t/invalid-reference-gc-crash-on-level-streaming/478607)

<div class="topic-metadata">

**Author:** [@Gabirobi03](https://forums.unrealengine.com/u/Gabirobi03)\
**Replies:** 2\
**Last updated:** [February 11, 2021, 11:53am UTC](https://forums.unrealengine.com/t/invalid-reference-gc-crash-on-level-streaming/478607 "2021-02-11T11:53:39Z")

</div>

Hello! We have been struggling several days with game crashes on our just released game on Steam and Switch - apparently the amount of crashes in our small studio’s internal playtests seemed insignificant but now we’ve …

---

## [Dirty old UMG widget instances are returned by CreateWidget()](https://forums.unrealengine.com/t/dirty-old-umg-widget-instances-are-returned-by-createwidget/476637)

<div class="topic-metadata">

**Author:** [@Kafumanto](https://forums.unrealengine.com/u/Kafumanto)\
**Replies:** 2\
**Last updated:** [January 5, 2021, 3:25pm UTC](https://forums.unrealengine.com/t/dirty-old-umg-widget-instances-are-returned-by-createwidget/476637 "2021-01-05T15:25:21Z")

</div>

With UE4.26,a call to CreateWidget() can return an old “dismissed” instance of a UMG widget if the same name is used. The returned instance retains the old state of when it was supposedly “dismissed”. This was not happen…

---

## [Garbage collection related error on Android](https://forums.unrealengine.com/t/garbage-collection-related-error-on-android/475973)

<div class="topic-metadata">

**Author:** [@aethaedd](https://forums.unrealengine.com/u/aethaedd)\
**Replies:** 1\
**Last updated:** [December 21, 2020, 5:01am UTC](https://forums.unrealengine.com/t/garbage-collection-related-error-on-android/475973 "2020-12-21T05:01:53Z")

</div>

Packaging for Oculus Quest, testing a field builder where the user can add bunkers and re-arrange them then save the field. When its saved I iterate through all the bunkers and store an array of transforms and bunker id’…

---

## [STEAM\_CALLBACK\_MANUAL being deleted by Garbage Collection](https://forums.unrealengine.com/t/steam_callback_manual-being-deleted-by-garbage-collection/475272)

<div class="topic-metadata">

**Author:** [@Joe\_Hogan23](https://forums.unrealengine.com/u/Joe_Hogan23)\
**Replies:** 1\
**Last updated:** [December 2, 2020, 2:35pm UTC](https://forums.unrealengine.com/t/steam_callback_manual-being-deleted-by-garbage-collection/475272 "2020-12-02T14:35:57Z")

</div>

I’m implementing some Steam API callbacks, manually because the automated STEAM\_CALLBACK is triggering twice. The STEAM\_CALLBACK\_MANUAL is only calling once when registering a function, but it is removed after about 30 s…

---

## [UObjects in use destroyed by GC](https://forums.unrealengine.com/t/uobjects-in-use-destroyed-by-gc/472354)

<div class="topic-metadata">

**Author:** [@ISeeIcySea](https://forums.unrealengine.com/u/ISeeIcySea)\
**Replies:** 2\
**Last updated:** [October 4, 2020, 7:17pm UTC](https://forums.unrealengine.com/t/uobjects-in-use-destroyed-by-gc/472354 "2020-10-04T19:17:53Z")

</div>

Hello, I have a TArray of pointers to UObjects in a custom class, that I create at runtime using NewObject(). I am performing an action on those UObjects on tick, but I’ve noticed that after 60s, the garbage collector …

---

## [What is the best practice for storing a reference to a component belonging to another actor?](https://forums.unrealengine.com/t/what-is-the-best-practice-for-storing-a-reference-to-a-component-belonging-to-another-actor/468830)

<div class="topic-metadata">

**Author:** [@clockwise\_mu](https://forums.unrealengine.com/u/clockwise_mu)\
**Replies:** 1\
**Last updated:** [July 29, 2020, 4:56pm UTC](https://forums.unrealengine.com/t/what-is-the-best-practice-for-storing-a-reference-to-a-component-belonging-to-another-actor/468830 "2020-07-29T16:56:09Z")

</div>

What is the best practice for referencing a component to another actor? I am storing references to components that belong to other actors within certain actors. I am wondering what the suggested way to implement this, i…

---

## [Are interface calls thread safe](https://forums.unrealengine.com/t/are-interface-calls-thread-safe/427082)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_ff0ebfa4](https://forums.unrealengine.com/u/anonymous_user_ff0ebfa4)\
**Replies:** 4\
**Last updated:** [August 21, 2019, 11:33am UTC](https://forums.unrealengine.com/t/are-interface-calls-thread-safe/427082 "2019-08-21T11:33:33Z")

</div>

Dear community, I have a strange problem with interfaces. My async task does some interface calls in loop via Execute\_… method. And at that moment when GC starts, next call throws assertion !IsUnreachable() on calling o…

---

## [\[C++\]Widgets and Force Garbage Collector](https://forums.unrealengine.com/t/c-widgets-and-force-garbage-collector/442532)

<div class="topic-metadata">

**Author:** [@evethir](https://forums.unrealengine.com/u/evethir)\
**Replies:** 4\
**Last updated:** [June 21, 2019, 7:58am UTC](https://forums.unrealengine.com/t/c-widgets-and-force-garbage-collector/442532 "2019-06-21T07:58:26Z")

</div>

Hi everybody! I’m working with widgets in C++ and I’m testing the garbage collector of the Engine. My scenario is that I’ve a pointer to a widget instance, at a certain point I need to destroy the widget: for what I’ve …

[Next page](https://forums.unrealengine.com/tag/garbage-collector/2052.md?match_all_tags=true&page=1&tags%5B%5D=garbage-collector)
