Tagged: 

Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #32949
    Profile photo of Chrisroll
    Chrisroll
    Participant

    Hi, Robin,

    I finally managed to isolate the origin of this PHP memory error:

    Fatal error: Out of memory (allocated 77594624) (tried to allocate 135168 bytes) in /home/dpasscom/public_html/wp-includes/wp-db.php on line 2515
    Fatal error: Out of memory (allocated 77594624) (tried to allocate 45056 bytes) in /home/dpasscom/public_html/wp-includes/wp-db.php on line 1926

    When I comment these lines in tools-queries.php file, image processing is OK and I get no memory error message :

    if ($c = $wpdb->get_results($querystr, ARRAY_N)) foreach ($c as $p) $result[] = $p[0];
    ss_clear_cache();

    I get this memory error with a test webhosting but not with BlueHost.
    Is there a php/memory/ mysql parameter to change to get rid of this error ?
    Is there any inconvenience in deleting these lines which, from what I understand, are used to “Re-thumbnail as necessary” ?

    Thanks,

    Chris

    #32952
    Profile photo of Robin
    Robin
    Keymaster

    Hey Chris – good find!

    So this is actually a very simple line that queries all of your store products and stores their IDs in an array. So at most you would have an array with about 2000 entries, which should not be a problem at all.

    Regardless, try changing this:

    
    if ($c = $wpdb->get_results($querystr, ARRAY_N)) foreach ($c as $p) $result[] = $p[0];
    

    to this:

    
    if ($c = $wpdb->get_results($querystr, ARRAY_N)) foreach ($c as $key => $p) {
    		$result[] = $p[0];
    		unset($c[$key]);
    	}
    

    #32953
    Profile photo of Robin
    Robin
    Keymaster

    Oh and just so there’s no ambiguity – you cannot comment that line out without completely breaking everything in your entire store.

    #32954
    Profile photo of Chrisroll
    Chrisroll
    Participant

    Hi Robin,

    Sadly, always the same memory error occurs after code change :

    Memory at start : 70M Memory at load 1M 1 new/updated images/videos parsed

    Fatal error: Out of memory (allocated 75497472) (tried to allocate 20480 bytes) in /home/dpasscom/public_html/wp-includes/wp-db.php on line 2513
    Fatal error: Out of memory (allocated 75497472) (tried to allocate 319488 bytes) in /home/dpasscom/public_html/wp-includes/wp-db.php on line 1924

    #32955
    Profile photo of Chrisroll
    Chrisroll
    Participant

    NB : I commented out line only in “ss_get_all_products” function to get rid of error message (line 75).

    Other occurences of this line in tools-queries.php file don’t pose problem.

    #32956
    Profile photo of Robin
    Robin
    Keymaster

    Hey Chris – yeah, there’s no way to circumvent that line. It should not be an issue – retrieving 2000 records from a database (or 1200) and entering their IDs into an array is a simple and very common action. Also, as previously mentioned, your script is being terminated at 75MB of memory – your host is not correctly setting your limits and I suggest you try to find an alternate solution.

Viewing 6 posts - 16 through 21 (of 21 total)

You must be logged in to reply to this topic.