I have a problem that drives me nuts for some time, and can't find a solution to it :-(
From time-to-time I get this error message on our wordpress/woocommerce site
Fatal error: Allowed memory size of 201326592 bytes exhausted (tried to allocate 1048576 bytes) in xxxxx/wp-includes/wp-db.php on line 1842
After refresh, the page loads regularly.
I checked the referenced lines in wp-db.php, and it is this code:
$num_rows = 0;
if ( $this->use_mysqli && $this->result instanceof mysqli_result ) {
while ( $row = mysqli_fetch_object( $this->result ) ) {
$this->last_result[$num_rows] = $row;
$num_rows++;
}
While searching the net, I found some tips for solution, like checking MySQLi, enlarging php memory, optimising database (deleting orphaned post-meta and WPs Automatic Database Optimizing), but none of them worked. The host says the memory is not any problem with the load of the server, but it is some coding issue.
Any idea how I can find the problem that needs fixing?
I tried the ini_set('memory_limit', '-1');
hack to make the php memory infinite (I know it is not a good practise), but it didn't help.
Any idea how this issue can be traced down, which code makes the mess?