Out of memory exception freezes unity

Mondain

New member
Hi

I have some issues with behavior designer.

If I modify a behavior tree (prefab in project view) and I click on a instance of this prefab (in scene view), unity is freezing.

Strange stuff is also happening:
- Behavior tree branches disappear.
- Made changes revert suddenly.
- Behaviour tree of same prefab are different.

Sometimes I can't start again my project, because if I start unity, it freezes immediately (because the prefab is selected).
I closed unity more than 15 times with task manager in the last days and I deleted the library multiple times (to revert selection and get control over my project).

I found this error:
behavior_angry.jpg

Hope you can help me.

Best regards!
 
Did you just leave a review on the Asset Store? There was a recent review left and it looks similar to the error that you are getting.

Can you send me a repro scene so I can take a closer look at that error?
 
Yes you're right.

While I was creating a repro scene, I recognized: I only can edit behaviour trees of prefabs if I edit the prefab instance (click "Open Prefab" in project view). But in my case, I can edit the prefab in project view directly :eek:

Perhaps this is the reason for all my problems...

behavior_angry2.jpg
 
Do you have "Allow Edit of Prefab Instances" enabled within the Behavior Designer preferences? This preference exists because I've seen Unity corrupt prefab values as it is trying to merge the prefab instance data.
 
No, I changed nothing.

I will clean up my scene and solve all exceptions and warnings. Perhaps some magic will happen.

behavior_angry3.jpg
 
The problem is still not solved.
The out of memory issue is still happening, also if I modify the prefab in prefab editing mode.

You cannot get a clue from the error?
 
If you can send me a repro scene I can take a closer look at the cause, but I haven't seen that error before so I'll need some type of a repro scene.
 
Hello Justin. I have a similar problem. Please provide me your GitHub username so I can share to you my project.
 
If you can send me a zipped up project that would be great - it'll be quicker than having to download a local copy of the entire repository :)
 
I have the same problem when applying a prefab which I've changed a behavior on. This is an extremely disruptive problem at the moment.
 
You can clear the startup scene in Library/LastSceneManagerSetup.txt as a workaround. Open the offending scene, create a new scene (multi edit) move everything except for the offending object into that new scene, save over existing scene.

It's a pain in the ass but it lets you get back into your project. Is there any progress on the cause of this issue? It's happened to me twice in the span of a week.
 
I haven't gotten a repro scene that shows the out of memory error so there hasn't been any progress. This is also likely project/machine dependent so it'll be tough to reproduce across all machines.

In general though there really isn't much that can be done for out of memory other than to use less of it in your game. If you look at the profiler you can see what assets are using the most memory and then reduce from there.
 
This happens as a result of saving a prefab after changing some things in a behavior designer tree. I'll see if I can send a repro case. I've never had anything like this other than UCC/BD, pretty positive it has something to do with your assets.
 
Hi Justin, I'm just checking in to report the same error. So it still exists, and it's clearly hard to reproduce. I can't begin to tell you what caused it, other than it happened after I simply deleted one of the tasks in a tree and then I believe I applied it to all instances of the prefab which is when the out of memory error began showing up.

I'm now trying to figure out how I can get back into my project, and disable Behaviour Designer to get it out of its bad state. Can't give you anymore than the image below, as it's too laggy to do much else.

Screen Shot 2020-07-09 at 2.05.22 pm.png
 
Besides it's instability issues, your tool is great. I've made some really powerful "intelligent" AI that would've been incredibly difficult without BD.
 
One way to fix this is to import the runtime source and set a breakpoint at the location that it is trying to allocate too much memory. From here you can set a limit on the number of elements that it is trying to allocate.

Are you using prefabs? It seems these type of problems come up when you're using binary serialization and prefabs with Unity merging the prefab data. One way to work around this is to use JSON serialization.
 
Top