WP_Background_Process::memory_exceeded()

Memory exceeded


Description Description

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


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: vendor/deliciousbrains/wp-background-processing/classes/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 );
	}

Top ↑

User Contributed Notes User Contributed Notes

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