Skip Navigation

[Resolved] Fatal Error Memory Exceeded

This thread is resolved. Here is a description of the problem and solution.

Problem:
Fatal error: Allowed memory size of bytes exhausted

Solution:

You can find proposed solution with the following reply:
https://toolset.com/forums/topic/fatal-error-memory-exceeded/#post-409605

Relevant Documentation:
https://toolset.com/documentation/user-guides/debugging-types-and-views/

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 9 replies, has 2 voices.

Last updated by tony 6 years, 5 months ago.

Assigned support staff: Minesh.

Author
Posts
#409031

We are testing the viability of using Toolset and WordPress for a website that will display over 20,000 products and have hit a memory problem a lot earlier than expected.

We loaded around 2,000 products and then went into WP to display the products table which failed with:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 112 bytes) in /home/hotelacc/public_html/wp-includes/meta.php on line 838

The front end display works fine.

I know we can increase memory from 256M to 512M but if that only extends the product limit to 4000 it will probably fail again. If memory requirements for 20,000 products turns out to be 2500M+ this seems rather excessive when all we are trying to do is display the first few products in the back office.

We have 41 post fields (reduced from 90) and need to know whether we have to rethink what we are doing with Toolset and WP. We are also not sure what the memory use relates to or whether it is a WP or Toolset problem.

Please can you advise whether you are aware of this type of problem with large volume websites?

Thanks
Tony

#409138

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Have you tried to set the memory limit for WordPress backend? if no:

Could you please try to add following line of code to your wp-config.php file:

define( 'WP_MAX_MEMORY_LIMIT', '256M' );

We have few articles where we demonstrated how you can build large sites using toolset:
=> https://toolset.com/2014/11/build-large-music-catalog-views-parametric-search-case-study/
=> https://toolset.com/2014/11/efficient-migration-wordpress-types-views-help-organize-complex-mass-content-save-time/
=> https://toolset.com/documentation/user-guides/how-to-use-views-parametric-search-on-large-sites/
=> https://toolset.com/documentation/user-guides/views-pagination/

I believe 2000 entries will not be an issue with Types and views (but depends upon the filters you have added and pagination enabled) but you need to follow the guidelines as given above so you can achieve your goal.

#409146

OK I have read these posts before but will look at them again.

I added the suggested line of code to my config file and got:
-------------------------------
Notice: Constant WP_MAX_MEMORY_LIMIT already defined in /home/hotelacc/public_html/wp-config.php on line 93

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 64 bytes) in /home/hotelacc/public_html/wp-includes/meta.php on line 838
-------------------------------

I then inceased the limits and got the same messages.

line 93 - define( 'WP_MAX_MEMORY_LIMIT', '512M' );
line 94 - ini_set("memory_limit","512M");

I think there may be another limitation somewhere else.

Tony

#409147

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I need to check on your install.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#409161

I have set up an FTP account for you. Please let me know if you need the access details - password is the same as before.

Tony

#409427

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Yes - could you please send me FTP access details.

#409568

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please check now, I can see admin and products page is loading at admin.

#409596

Thanks Minesh

That seems to be working, please can you tell me what you changed so that we can avoid the problem in the future.

Tony

#409605

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I've added the following code to wp-config.php at top of the file:

ini_set("memory_limit","512M"); 
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

Also, the order of code was wrong, you first used define() and then ini_set(). It should be first ini_set() and then define().

I hope this information will help you to resolve your issue.

#409615

OK thanks Minesh.

We will do some more testing. We expected this problem to be resolved with more memory (we just got the coding wrong in wp-config.php) - thanks for the correction.

Kind regards
Tony