after updating social_auth to latest rc version, When trying to execute the updb for "social_auth_post_update_encrypt_tokens" it throws error:
> PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php on line 506
> [warning] Drush command terminated abnormally. Check for an exit() in your Drupal site
Need improvement for the batch process that we have in the hook. which executes multiple queries to fetch all the results and there seems an issue with batch process as well, as it executes in double of previously executed records.
Here's the attached screen shot:

As you can see the number of records it executes in the next batch like 10, 30, 70..... which makes it hard to execute, when we have more number of records. In my case the results are in lakhs.
Comments
Comment #2
miteshmapRefactored the way we fetch records and update results. Here's the screenshot of improvement:

Comment #3
miteshmapComment #4
miteshmapComment #5
miteshmapComment #6
miteshmapComment #7
miteshmapComment #8
miteshmapUpdated patch to fetch records from database during batch execution, instead of storing it as array in a variable.
Comment #9
miteshmapComment #10
miteshmapComment #12
wells