Memory leak when using EnvQuery copies

Build Type: Binary

Build version: 4.12.5 - 3039270

Detailed description of the issue:

When using a copy of an Environment Query blueprint, the EQS system doesn’t free up memory after executing the query. It results in the memory getting slowly filled over time without getting GC.

The attached screen shows the objects in memory after a few minutes of gameplay. None of the tests have been cleared since the start of the game. The counts was the same after forcing the GC by running “obj gc”.

In short, duplicating a query blueprint to create a new query will result in the new query not getting GC when used.
From what I could gather, it happens whatever the query and even if once copied, we empty the query of tests.

Edit:

Deactivating EQS on the project gave a few thousands of:

“[2016.08.10-04.16.17:452][ 0]LoadErrors:Warning: Warning CreateExport: Failed to load Outer for resource ‘EdGraphPin_1’: EnvironmentQueryGraphNode_Option /Game/Levels/AITestLEvel.AITestLevel:EnvQueryManager_3.EnvQuery_441.EnvironmentQueryGraph_0.EnvironmentQueryGraphNode_Option_0”

So it does seem like they get saved in the level by some dark magic of the reference system. :slight_smile:

Repro Steps:

  • Create empty project
  • Activate EQS in the project settings
  • Add a pawn with an AI controller and an empty behavior tree
  • Create an environment query doing whatever
  • Copy the blueprint of this query
  • Add “Run EQS” service to the behavior tree with a wait node
  • Set the copy of the previously created query as the query to execute in the “Run EQS” service.
  • Start simulate and watch the memory getting filled slowly over time.

102211-bugreporteqs.png

Hey Deams,

I’ve attempted to reproduce the issue, but I haven’t seen any noticeable memory increase. What sort of increase are you typically experiencing when this issue occurs? Could you provide a sort of “before and after” of what memory usage you’re seeing?

Thanks!

Hello,

I am marking this topic as resolved for tracking purposes, as we have not heard from you in a few days. If this issue persists, feel free to respond to this thread. For any new issues, please create a new Answerhub topic.

Have a great day

Hey !

Here I am again. I think I’m having this same issue. I made a new post here EQS Query eating up memory - Community & Industry Discussion - Epic Developer Community Forums so let me know if you can think of anything. Thanks!

Edit: Sorry, I just got scared before it capped out. No leak here. But please check my question for an additional detail.

So this isn’t quite resolved for me. I updated my question with details (link above). The problem is that it doesn’t cap out on my server, it eats up 4GB and then releases it all at once (down to 200MB). The GC should be managing things better than that, shouldn’t it? The stutter caused by releasing so much memory makes this an issue for me.