# Garbage collection, creating UObject while collecting garbage is not allowed

**URL:** <https://forums.unrealengine.com/t/garbage-collection-creating-uobject-while-collecting-garbage-is-not-allowed/2051311>\
**Category:** C++\
**Tags:** garbage-collector, uobject, fatal-error, garbage-collection, unreal-engine, question\
**Created:** [October 3, 2024, 12:49pm UTC](https://forums.unrealengine.com/t/garbage-collection-creating-uobject-while-collecting-garbage-is-not-allowed/2051311 "2024-10-03T12:49:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elites94](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Elites94](https://forums.unrealengine.com/u/Elites94)\
**Post date:** [October 3, 2024, 12:49pm UTC](https://forums.unrealengine.com/t/garbage-collection-creating-uobject-while-collecting-garbage-is-not-allowed/2051311/1 "2024-10-03T12:49:20Z")

</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!” appears.

The clients have no problem, but the server crash with this error after 1 or 2 hours of game. And sometimes it can run for like 4 hours without having any problem.

Is there any way to know what I tried to create when this error occurs ? to have more logs, or anything ? Because I have no idea of what it was trying to create so I will not be able to solve anything if I don’t know that…

And then, any clue of what I am supposed to do when I find what object is causing the issue ?

Some infos, my game is mainly in Blueprints, but have some C++ (plugins, and some other code). The game is quite huge so with this error it is really hard to understand what is causing that exactly.

Thank you for your help !

All the best

---

<div class="post-metadata">

**Author:** ![Elites94](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Elites94](https://forums.unrealengine.com/u/Elites94)\
**Post date:** [October 4, 2024, 8:36am UTC](https://forums.unrealengine.com/t/garbage-collection-creating-uobject-while-collecting-garbage-is-not-allowed/2051311/2 "2024-10-04T08:36:32Z")

</div>

Ok, sorry I didn’t read well. The objects was written juste before the “Creating UObjects while Collecting Garbage is not allowed!”.  
It was linked to a plugin I bought so I directly contacted the seller 🙂

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [November 3, 2024, 8:37am UTC](https://forums.unrealengine.com/t/garbage-collection-creating-uobject-while-collecting-garbage-is-not-allowed/2051311/3 "2024-11-03T08:37:17Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
