# GC messing up TArray without UPROPERTY

**URL:** <https://forums.unrealengine.com/t/gc-messing-up-tarray-without-uproperty/320560>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 3, 2015, 4:11am UTC](https://forums.unrealengine.com/t/gc-messing-up-tarray-without-uproperty/320560 "2015-06-03T04:11:14Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [June 3, 2015, 7:06pm UTC](https://forums.unrealengine.com/t/gc-messing-up-tarray-without-uproperty/320560/13 "2015-06-03T19:06:03Z")

</div>

I apologize for not being more detailed. UProperties are meant to expose the code to the editor itself for reflection, the facts of being able to add ‘EditAnywhere’ or ‘VisibleAnywhere’ are additional features that are not needed for reflection data to be generated, none of these specifiers are actually required. The garbage collector itself can see everything that is in the code. The problem is that anything that isn’t being reflected in the editor through UProperties is completely foreign to the garbage collector. More information about reflection data at the following link:

> **[Unreal Property System (Reflection)](https://www.unrealengine.com/de/blog/unreal-property-system-reflection)**
>
> Reflection is the ability of a program to examine itself at runtime. This is hugely useful and is a foundational technology of the Unreal engine, powering many systems such as detail panels in the editor, serialization, garbage collection, network...

When the garbage collector doesn’t know that something is being used, or when you set a reflected property to be destroyed, the garbage collector gets rid of it as it sees these things as useless. More information about the garbage collector itself can be found at this link:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

Non-UProperty variables still have their uses. They can for use inside of loops and functions, places where garbage collection will not occur and they will be used temporarily. Anything that is planned to be used long-term however, such as your array, should be a UProperty to ensure that it isn’t garbage collected.

I hope this helps.

---

_[View the full topic](https://forums.unrealengine.com/t/gc-messing-up-tarray-without-uproperty/320560)._
