User Tools

Site Tools


tutorials:memory_errors:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorials:memory_errors:start [2009/06/29 22:57]
jonyo wording
tutorials:memory_errors:start [2015/06/02 14:30] (current)
geojames [What Memory Limit Should Be]
Line 1: Line 1:
-====== PHP Memory Limit Error When Using Software ======+====== PHP Memory Limit Errors ======
  
-This error most often happens when clients of your site are uploading images to attach to their listings but can occur in some instances under basic script use with the default php memory limit value set at 8MB.  The most common error looks something like (if you see one in the browser at all):+This error most often happens when clients of your site are uploading images to attach to their listings but can occur in some instances under basic script use with the default php memory limit value set at 8MB, 16MB, 24MB or 32MB (most recently).  The most common error looks something like (if you see one in the browser at all):
  
   Fatal error: Allowed memory size of ######## bytes exhausted (tried to allocate ##### bytes) in /home/public_html/classes/order_items/images.php on line ####   Fatal error: Allowed memory size of ######## bytes exhausted (tried to allocate ##### bytes) in /home/public_html/classes/order_items/images.php on line ####
 +  
 +Memory usage by the script will only increase with time as we try to ever decrease page load times within the software.  We try to preserve memory usage as much as possible in the software, but there are parts of the software where more memory improves page load times.  For instance, when the software gets the title of a listing for the SEO addon to display the title in the URL, it saves the title in the memory so that any other links on the page for that same listing don't have to get the same data from the database.  These types of improvements decrease page load times and decrease the load on the database, but the trade-off is more memory usage.  A typical page load on the default front page, with all it's modules and addon tags being loaded, may have a "peak" memory usage of 24MB as reported by PHP.  That may sound ok and under any limits set in php but that does not include any "overhead" used by Apache itself.  Our software isn't the only one using that memory and there's no way for us to know what your host loads into memory along with our script.  The amount of memory used by the host is completely dependent on their configuration and differs from host to host depending on their needs.  Also note that different pages in the software require different memory needs than others.  We explain some of those situations within this page to better illustrate the issue.
 +
 +
 +===== Errors within the Geographic Setup and Geographic Navigation Addon Regions Admin Tools =====
 +
 +We've seen this appear to more clients with the release of v6.  This page loads all regions within the system to make the admin tool a lot easier to use.  This means that more memory is used to create the page in the first place thus the increase in memory limit errors.
  
 ===== Errors within the Categories admin tool...usually copying categories ===== ===== Errors within the Categories admin tool...usually copying categories =====
Line 22: Line 29:
  
 Also note that if your server is a 64-bit server, it will need more memory than a 32-bit server, as 64-bit servers have a larger memory footprint than 32-bit servers. Also note that if your server is a 64-bit server, it will need more memory than a 32-bit server, as 64-bit servers have a larger memory footprint than 32-bit servers.
 +
 +=====When using the Oodle or RSS feed features=====
 +
 +You see a memory limit error when using the Oodle or RSS feeds usually because you are trying to display too many listings through that feed for the amount of memory you have allocated to display it in.  You can either do one of two things here.  You can lower the number of listings you do try to display through those feeds to a point where you no longer see the error or you can increase the memory limit in php to a high enough limit to allow you to display all the listings you want to display through those feeds.  One thing to check though is the receiver of the feed.  Do they have a limit to how many listings they will receive through a feed?  If they do you will need to set the listing limit and then the memory limit if errors occur at that listing count level.  Think through this one a bit.  If you have 100,000 ads do you think the recipient will handle/import all those listings at once or at all?  Question the recipient and see what their wishes are.  If your feed is too big they may ignore it or only take the first 100 (or 500 or 10,000) no matter what you send to them.
  
 ===== Where the Error Appears ===== ===== Where the Error Appears =====
Line 29: Line 40:
 ===== What Memory Limit Should Be ===== ===== What Memory Limit Should Be =====
  
-As far as what memory limit you should have there is no telling.  We've seen our software work well in the default 8MB value that comes default.  But most servers this is not sufficient.  Almost ALL memory limit problems happen when uploading images.  On some servers we have seen the 64MB is the first value that doesn't cause any problems when uploading images.  Our first suggestion is 16MB then 32MB then 48MB and finally 64MB.  But note that even at 64MB you can exceed the memory limit when certain images are uploaded Keep increasing the value until you no longer see the error when uploading images.+As far as what memory limit you should have there is no telling.  We've seen our software work well in some default 32M configurations.  But for most servers this is not sufficient.  Almost ALL memory limit problems happen when uploading images.  Our first suggestion is 72M or above.  At those values we've seen almost no reports of issues.  If you see memory limit issues above 72M (128M or 256M) this should be reported to support for a possible closer examination  Keep increasing the value until you no longer see the error when uploading images. 
  
 ===== How and Where to Change the Memory Limit ===== ===== How and Where to Change the Memory Limit =====
  
-The memory limit is a PHP environment variable set within the php.ini file.  The php.ini file provides all of the configuration information PHP needs at start up.  Many hosts allow you the ability to edit the php.ini file directly.  Other hosts allow you to override some or all of the server wide php.ini values by inserting a php.ini file with the override values in your working directories.  Still other hosts want complete control of this file and any changes to that file requires them to make those changes.  As to which of the above situations happens with your host you will need to contact them to have the value changed.+The memory limit is a PHP environment variable set within the **php.ini** file.  The php.ini file provides all of the configuration information PHP needs at start up.  Many hosts allow you the ability to edit the php.ini file directly.  Other hosts allow you to override some or all of the server wide php.ini values by inserting a php.ini file with the override values in your working directories.  Still other hosts want complete control of this file and any changes to that file requires them to make those changes.  As to which of the above situations happens with your host you will need to **contact the host** to have the value changed
 + 
 +Changing the php.ini file is **not something Geo support can do**, it is essentially a **server setting** and therefore you need to **contact your host** if you are not sure how to change it.
tutorials/memory_errors/start.1246316263.txt.gz · Last modified: 2014/09/25 16:55 (external edit)