Fatal Error: Could not allocate memory

I am getting this error consistently (reproduced 6 times in a row) after approximately 1 hour of letting my game run in editor.

I was using 2019.2.5f1, then upgrade to 2019.2.21f1 to see if that would solve this issue. Packages involved are: collections, mathematics, jobs, burst. They are all updated to latest versions.

The main components in my game are unity terrains and Vegetation STudio pro. I am in contact with the author of Vegetation Studio, but he believes this error could be due to either a bug or perhaps some internal memory cap that unity might be reaching.


Here is typical performance:

There is small hiccups as a new terrain detail batch is loaded, but mostly it is consistent. The only consistency I can identify with this error is that it happens after about 40-60 minutes of running the game in play mode in editor.

I have tried reducing the total amount of terrains by 50%, but this made no difference in performance, and the crash/error still happens. Any advice is appreciated.

It looks like there is such thing as a memory profiler. I'll see if we can get that running and try to pinpoint where this problem is happening.

1 Like

Could be a memory leak. Check the Workflow for
Finding and fixing small continuous allocations during application lifetime. And also check the Memory Map Diff view and By Alloc Diff tables, in the later look for Native Array, those allocations are not Object allocations and wouldn't show up in the Tree Map or Objects tables and according to that popup, Native Arrays leaking might be what's going on here.

If taking and opening snapshots takes too long, you might want to update to 2019.3

1 Like