WP_Background_Process::get_memory_limit()protectedWC 1.0

Get memory limit

Method of the class: WP_Background_Process{}

No Hooks.

Return

Int.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_memory_limit();

WP_Background_Process::get_memory_limit() code WC 9.4.2

protected function get_memory_limit() {
	if ( function_exists( 'ini_get' ) ) {
		$memory_limit = ini_get( 'memory_limit' );
	} else {
		// Sensible default.
		$memory_limit = '128M';
	}

	if ( ! $memory_limit || -1 === $memory_limit ) {
		// Unlimited, set to 32GB.
		$memory_limit = '32000M';
	}

	return wp_convert_hr_to_bytes( $memory_limit );
}