Daxif icon indicating copy to clipboard operation
Daxif copied to clipboard

Workflow Sync can result in OutOfMemory Exception

Open mlRosenquist opened this issue 1 year ago • 2 comments

Describe the bug When performing workflow sync towards an environment it can result in OutOfMemory Exception.

After doing a bit of digging in DAXXIF, i am pretty sure i found the root. DAXXIF will hold the pluginassembly record in memory with a full columnset (quite large for an pluginassembly) x amount of times. x is here the amount of solutions which refer a given workflow version and dll name.

To Reproduce Steps to reproduce the behavior:

  1. Reference the an assembly "enough times" (ours was 30)
  2. Run the WorkFlowSync

Expected behavior The workflow sync should succeed no matter the amount of references it has to solutions.

Fix is most likely to add an condition to the LinkCriteria. /Common/CrmDataInternal ~ line 529-536.

Screenshots Local replication: oom-workflowSync

Environment

  • CRM/D365/CDS version: 9.2.23112.00216
  • Tool version: 5.3.1

mlRosenquist avatar Dec 21 '23 09:12 mlRosenquist

Looking into this one. It seems to happen in environments with a lot of processes (workflows, BPFs, etc.). This may happen if multiple D365 Apps such as Sales, Customer Service, Field Service, and Marketing arer all installed as well as having multiple custom processes. This makes the list of processes quite extensive and may therefore result in an OutOfMemoryException.

My initial thesis is also (as you mentioned) that the queries related to map out the processes seem to be using more information and therefore more memory than is actually needed. I'll optimize the queries and test it out.

bo-stig-christensen avatar Apr 29 '24 07:04 bo-stig-christensen

I optimized multiple queries and tested it on a live project having similar issues. Looking good. Performance of WorkflowSync has improved a factor 3, and large plugin assemblies are no longer an issue.

bo-stig-christensen avatar Apr 30 '24 22:04 bo-stig-christensen