BP_Background_Process::get_memory_limit()

Get memory limit.

Description

Return

(int)

Source

File: bp-core/classes/class-bp-background-process.php

141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
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 === intval( $memory_limit ) ) {
        // Unlimited, set to 32GB.
        $memory_limit = '32G';
    }
 
    return wp_convert_hr_to_bytes( $memory_limit );
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.