• Hello,

    Im having an issue with get_fields and update_fields. Following code seems to generate a memory leak from FastCGI/phpfpm.

    function acf_populate_smr_null($field){
        $subscriber_sun_field_key = "field_5f9b042b97bb0";
        if ( is_user_logged_in() ) {
            $post_id = get_post_id(bp_loggedin_user_id());
            $sub_lvl = acf_get_smr_level($field);
    
            $newField = get_field($field['key'], "user_143", false);
    
        }
        return($field);
    }

    Generates this code in Nginx:
    Apr 14 19:03:06 staging nginx[273037]: 2021/04/14 19:03:06 [error] 273037#273037: *6764 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 1077936128 bytes exhausted (tried to allocate 20480 bytes) in /var/www/staging.URL.com/wp-includes/functions.php on line 4461" while reading response header from upstream, client: **.**.**.** server: staging.URL.com, request: "GET /my-dashboard/ HTTP/2.0", upstream: "fastcgi://unix:/run/phpfpm/staging.sock:", host: "staging.URL.com", referrer: "https://staging.URL.com/stars/"

    When newFields var is commented out the memory leak goes away. As you can see ive temporarly increased memory size to 1028mb.

    • This topic was modified 5 years, 1 month ago by yooloolu.

The topic ‘Possible Memory Leak’ is closed to new replies.