Skip to content

Memory limit when generating large amounts of test data #152

Open
@mikkamp

Description

@mikkamp

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

I tried to generate a large set of orders for testing (50k), however it seems that this eventually runs out of memory (1GB):

$ wp wc generate orders 50000 --date-start=2010-01-01 --date-end=2024-12-10
Generating orders  6  % [=======>                                                                                                              ] 33:14  / 478:53
2024/12/11 11:40:10 Resident memory usage of 1258954752 bytes exceeded maximum allowed value of 1258291200

    3.0mb	/bin/bash -i -l
  989.6mb	/usr/local/php8.3/bin/php /usr/local/bin/wp-cli --path=/srv/htdocs/__wp__/ wc generate orders 50000 --date-start=2010-01-01 --date-end=2024-12-10

I haven't looked into the details of the memory usage, but from this run it seems like it's not cleaning up some things after creating an order which is making the used memory grow, till it runs out.

WordPress Environment

Pressable site with:

WordPress 6.7.1
WooCommerce 9.4.3
WooCommerce Smooth Generator 1.2.1

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only WooCommerce and WooCommerce Smooth Generator plugins are active.
  • This bug happens with a default WordPress theme active, or Storefront.
  • I can reproduce this bug consistently using the steps above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions