Allowed memory size exhausted during installation
-
Hi, I was just starting to evaluate ATUM and I’m getting the “Allowed memory size exahsuted” (I’m using 512MB!) The issue happens on this callstack:
apply_filters (dev-wp/wp-includes/plugin.php:184) wpdb->get_col_charset (dev-wp/wp-includes/wp-db.php:2811) wpdb->process_field_charsets (dev-wp/wp-includes/wp-db.php:2465) wpdb->process_fields (dev-wp/wp-includes/wp-db.php:2392) wpdb->_insert_replace_helper (dev-wp/wp-includes/wp-db.php:2216) wpdb->insert (dev-wp/wp-includes/wp-db.php:2160) Atum\Inc\Upgrade->migrate_atum_products_data (dev-wp/wp-content/plugins/atum-stock-manager-for-woocommerce/classes/Inc/Upgrade.php:479) Atum\Inc\Upgrade->create_product_data_table (dev-wp/wp-content/plugins/atum-stock-manager-for-woocommerce/classes/Inc/Upgrade.php:401) Atum\Inc\Upgrade->__construct (dev-wp/wp-content/plugins/atum-stock-manager-for-woocommerce/classes/Inc/Upgrade.php:97) Atum\Inc\Main->pre_init (dev-wp/wp-content/plugins/atum-stock-manager-for-woocommerce/classes/Inc/Main.php:141) WP_Hook->apply_filters (dev-wp/wp-includes/class-wp-hook.php:287) WP_Hook->do_action (dev-wp/wp-includes/class-wp-hook.php:311) do_action (dev-wp/wp-includes/plugin.php:478) require_once (dev-wp/wp-settings.php:540) require_once (dev-wp/wp-config.php:77) require_once (dev-wp/wp-load.php:37) require (dev-wp/wp-blog-header.php:13) {main} (dev-wp/index.php:17)
Which points to this line:
// Insert a new row of data. $inserted_row = $wpdb->insert( $wpdb->prefix . 'atum_product_data', $new_data );
This line is called during a foreach loop that iterates on all products. We have 30K+ products so obviously things are going sideways here.
A few things that would need to happen:
– memory has to be properly managed during the loop
– there should be a process by which the Upgrade() call is not done in the pre-init but rather in the setup/settings page such that it can be async (progress bar) OR a WP-CLI command that allows this to run for for a while without hitting any time-limits set by the apache php settings.Any ideas or pointers are much appreciated! can also contribute to any fix I find.
Thanks.
- The topic ‘Allowed memory size exhausted during installation’ is closed to new replies.