Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #9937 - Resolve high memory usage when performing bulk relationship changes #9938

Conversation

simonr44
Copy link
Contributor

@simonr44 simonr44 commented Feb 9, 2023

Description

When adding or removing multiple relationships the beans are loaded and stored within the tempBeans array in data/Link2.php file.

When performing lots of changes at once, for example when performing bulk actions or updating target lists this leads to runaway memory usage.

This fix unsets the bean from the temporary array as it is no longer necessary to remain in storage.

Motivation and Context

Has potentially wide ranging impacts when record numbers and bulk actions increase.

How To Test This

  1. Prepare demo data with a reasonably large number of account records (e.g. 2000)
  2. Create an empty Target List
  3. Attempt to bulk assign all 2000 accounts to the target list
  4. Monitor the php memory usage, it should now remain at very low levels.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

@serhiisamko091184 serhiisamko091184 added Status: Requires Code Review Needs the core team to code review Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member labels Mar 27, 2023
@serhiisamko091184
Copy link
Contributor

Hello @simonr44 ,
thank you so much for your contribution!

Regards,
Serhii

@clemente-raposo clemente-raposo added Status: Requires Testing Requires Manual Testing Status: Passed Code Review Mark issue has passed code review reviewed and removed Status: Requires Code Review Needs the core team to code review labels May 22, 2023
@chris001
Copy link
Contributor

chris001 commented May 23, 2023

Shouldn't the branch be hotfix not hotfix-7.13.x ? Or not?

Copy link
Contributor

@johnM2401 johnM2401 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Significantly faster & lower mem-usage on mass-relationship-changes.
(Tried mass-relating 3k Accounts to a Targetlist, took about 50% resources as before)
(Also tried mass-updating 3k accounts to change user, was ~5 minutes faster)

@johnM2401 johnM2401 added Status: Passed Testing and removed Status: Requires Testing Requires Manual Testing labels Jun 2, 2023
@jack7anderson7 jack7anderson7 merged commit ce80539 into salesagility:hotfix-7.13.x Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status:Assessed PRs that have been tested and confirmed to resolve an issue by a core team member Status: Passed Code Review Mark issue has passed code review reviewed Status: Passed Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants