We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Allowed memory size issues [Solution] | Forum

dave Leader
dave Oct 30 '13

Preface:  I posted this here just as a help post to those having these kinds of issues. I did a search on the forum for "Allowed memory size" and found that most of the issues regarding that subject  are in this section so that's why I posted this here.

 

This does not encompass all situations and obviously will not resolve all issues but this addresses what I believe is the most common issue.  Maybe one day Oxwall can trap this error in the core database.php  file and actually issue a message to the user suggesting this so they do not have to look it up.

 

This also assumes you know the proper way to open and edit a file and not to ever use any kind of word processing editor (example: word) on a coding file.  (notepad or notepad++ or programmers notepad only)

 

Issue:  The allowed memory size has been exhausted, and this message in your cPanel error log:   "Allowed memory size of 33554432 bytes exhausted (tried to allocate 32 bytes) in /home/xxxxxx/public_html/yoursite.com/ow_core/database.php on line 433"   with of course xxxxx being your cpanel login name and yoursite being your site name.  

 

Occurrence: This can occur when you move servers or at first install or even during normal live product execution.  For me I just moved servers, same host, same files, just a different server and all of  sudden out of nowhere came this issue.

 

When this occurs one of the visual indications is that you will not have a theme to speak of, all your images, text, links, and everything on the page will be scattered mostly to the left side of the page, and on a white background with no css or theme visuals at all. 

 

What is this telling me:  It is telling you that the core file attempted to grab enough memory to execute the process but was terminated due to not enough memory.

 

Solution:  Give it more memory and refresh your cache. 

 

1. First figure out how much it needs, it is telling you by the number in the error message, example mine said  33554432 bytes .  Even though it says 32 bytes in the message and in this case it is 32MB its always better to convert it anyway to make a better judgement.

 

2. now convert that number, there are many of these converters out there but I like this one (its simple and does not try to sell me anything)

 

go to http://www.thebyteconverter.com/

 

and in the byte section post your number of bytes from the error message.

 

so the conversion says that  33554432 is 32MB. 

 

2b. now we don't want to give it just enough to work, we want to allow for some flexibility.   So depending on your host and if they allow you to do this or not, I would double that or even triple that amount.  

 

For me I allowed it to grab 100MB, but your host may freak if you do that..  So double it and see what happens, you can always add to it later.

 

 OK so we know we are going to allow it to grab 64MB of memory or whatever you decide is best for you...

 

CAUTION: don't get greedy, trust me if you make this 900MB you can expect a nasty note from your host rather quickly and they may take away this option on your server..  I would not go any more than 100MB unless you get permission first.

 

3. If your Oxwall site is in a sub directory you will need to do this twice, once for the root dir (your public_html) and once for your oxwall directory.  Even if your sub dir is an add on domain, the root public html domain still has some affects on this so that's why you need to do both.

 

    If your Oxwall domain is the root domain (public_html) you only need to do this once. 

 

3a. find the php ini file and open it and add this line:

 

   memory_limit = 64M

 

save it and done..

 

4. Now open your htaccess file in same dir and add this line

 

 php_value memory_limit 64M

 

save it and done

 

5. The reason you do both is as a failsafe, not all php ini file commands are executed by the server, some servers don't allow them to be executed from that file via the server config. However many servers allow this to be done via the htaccess file.  So this will cover both situations.

 

6. Now that you have allowed it more memory, try refreshing your page to see if it resolves, if not you will need to set your dev mode to true and refresh your cache that way or type the admin url in the browser and log in and use your plugin to clear the cache.

 

The site should come up now normally with your theme and all its glory. 

 

 

Thanks and I hope this helps someone..

 

Dave

       

The Forum post is edited by Alia Nov 4 '13