Unity 2019.1.10f1 Out of Memory Error on Startup - Probably Serialisation Bug

Im having a class where i simulate enums like in java.

Its basically an array of elements
public T[ ] enumList;
which gets filled by its subclass. The index is the enums int value.

I didnt do a build for a month and meanwhile upgraded to the 2019 version.
When i tried to do a build i suddenly got an crash in most of my scenes.
After numerous tests i figured out the EnumListDrawerGeneric<T, E> : MonoBehaviour lead to that error.

Im having a scene with a single gameobject and a single mono: DataChickenMamaColorsTypes.
When the enumlist has no elements no errors are printed.

When it has 1 -4 elements i get this msg:

2019.10.30 15:16:52.101 15249 17066 Error Unity: A scripted object (probably DataChickenMamaColorsTypes?) has a different serialization layout when loading. (Read 132 bytes but expected 148 bytes)
2019.10.30 15:16:52.101 15249 17066 Error Unity: Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?

When it has about 8 elements:
Trying to allocate: 1936617316B with 16 alignment. MemoryLabel: String
2019.10.30 13:47:02.510 28034 30257 Error Unity: Allocation happened at: Line:314 in ./Runtime/Core/Containers/StringStorageDefault.h

I dont use UNITY_EDITOR in those files. Ill create a empty project later end check this out again.

Has anyone experienced similar behaviour?
It seems as if the generic array stuff

public T[ ] enumList; leads to that error? Which used to be an error in older unity versions?

Edit: an other subclass with lots of elements didnt cause any troubles. it may be some problems with one of the attributes. gona investigate later

Please show your code and minimal steps to reproduce

Another class works just fine. Recreating the class also triggers that error.

Using the same datastructure also leads to that error. So i guess there is some version conflict somewhere.
I assume that my library folder is broken, i changed my projects path last month since i needed to get it out of the cloud sync path. It may locked some files.

Ill update to the latest unity version - and test again - is there a way to rebuild the library folder from scratch?

thanks

Yes, follow these steps

  • Exit Unity
  • Make a project backup
  • Delete the /Library folder
  • Open Unity. The Library will be rebuilt on load