Astra_WP_Background_Process::memory_exceeded()

Memory exceeded


Description

Ensures the batch process never exceeds 90% of the maximum WordPress memory.


Return

(bool)


Source

File: inc/lib/batch-processing/class-astra-wp-background-process.php

		protected function memory_exceeded() {
			$memory_limit   = $this->get_memory_limit() * 0.9; // 90% of max memory
			$current_memory = memory_get_usage( true );
			$return         = false;

			if ( $current_memory >= $memory_limit ) {
				$return = true;
			}

			return apply_filters( $this->identifier . '_memory_exceeded', $return );
		}


User Contributed Notes

You must log in before being able to contribute a note or feedback.