VirtueMart Forum

VirtueMart 2 + 3 + 4 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: cmb on November 27, 2012, 20:29:55 PM

Title: [Solved] Out of Memory Error Apparently Related to SEO
Post by: cmb on November 27, 2012, 20:29:55 PM
I have installed VirtueMart 2.0.14 on a Joomla 2.5.8 Website. I have one category and one product. There are no images and no custom fields. Caching is disabled.

When I select a link to a category layout in the front end, I encounter this and similar errors:

Fatal error: Out of memory (allocated 29622272) (tried to allocate 7680 bytes) in /home/sgenetic/public_html/sitetest/al/libraries/joomla/application/categories.php on line 100

In various tests that I have run, the "tried to allocate" value, the file name and the line number may vary. If I change the menu item to link to the product detail, the results are similar.

I have verified that the PHP setting for memory_limit is 128M.

If I disable the Joomla and the VirtueMart SEO, the menu links work occasionally. At other times I see:

Fatal error: Out of memory (allocated 29622272) (tried to allocate 76 bytes) in /home/sgenetic/public_html/sitetest/al/libraries/joomla/base/object.php on line 194 or similar messages.

How can I repair this Website?

VirtueMart 2.0.14, Joomla 2.5.8, Apache server, PHP Version 5.3.15
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 27, 2012, 21:49:06 PM
Hello,

Increase you php memmory limit: http://forum.virtuemart.net/index.php?topic=109732.0
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 27, 2012, 21:52:02 PM
Quote from: bytelord on November 27, 2012, 21:49:06 PM
Increase you php memmory limit...
How high should I go? I'm already at 128 megabytes and the error is at fewer than 30 megabytes.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 27, 2012, 22:09:50 PM
Hello,

Are you sure you have increase your memory? Did you restart apache? is local host or on a live server? did you try the .htaccess file?

If you use a live server and you cannot change your php limits please ask your provider to do it for you (may be is locked).

Regards
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 27, 2012, 23:58:11 PM
Quote from: bytelord on November 27, 2012, 22:09:50 PM
Are you sure you have increase your memory?
Yes, I verified it by changing it in .htaccess. I can see the change in phpinfo(). It is really at 128 megabytes. The error occurs way down at 29+ megabytes.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 28, 2012, 00:03:25 AM
This one related to joomla libraries, but did you restart your apache?
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 28, 2012, 00:06:47 AM
Quote from: bytelord on November 28, 2012, 00:03:25 AM
...did you restart your apache?
I can't. It's not my server.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 28, 2012, 00:27:04 AM
Strange, but you could change your php.ini file ...
If you use a VPS you could restart your node through whm/cpanel or ask your hosting provider to increase it for you.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 28, 2012, 00:31:20 AM
Quote from: bytelord on November 28, 2012, 00:27:04 AM
Strange, but you could change your php.ini file ...
My host requires changes in the PHP configuration to be made through the .htaccess file. Any php.ini files are not recognized. The former works great, though.

The strange part is that the failure is intermittent. I thought I traced it to the SEO settings. It worked once or twice. Now I get the fatal error with all the SEO disabled.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 28, 2012, 00:32:47 AM
Try to ask from your hosting provider to increase the memory size and the the timeout limits for your PHP

Regards
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 28, 2012, 00:37:26 AM
Quote from: bytelord on November 28, 2012, 00:32:47 AM
Try to ask from your hosting provider to increase the memory size and the the timeout limits for your PHP
I can easily set it myself. The memory limit is set to 128 megabytes and the maximum execution time is at 30 seconds. The fatal error occurs well below those limits. About 30 megabytes and 2 or 3 seconds.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 28, 2012, 00:41:08 AM
Not sure, your error related to joomla category library ... try also under joomla forum...

http://forum.joomla.org/viewtopic.php?p=2591157#p2753608

try also .htaccess file is everything is ok, also check the mod_rerwite under joomla configuration
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 28, 2012, 00:46:56 AM
Quote from: bytelord on November 28, 2012, 00:41:08 AM
Not sure, your error related to joomla category library ...
The errors are reported in various libraries. Sometimes it's categories. Sometimes elsewhere. It depends on what Joomla is doing when it runs out of memory. It only happens when I'm trying to get to the VirtueMart page, though.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 28, 2012, 01:21:42 AM
I don't know

I still think that is related to your PHP memory size, even joomla standard installation need 128mb, please contact your hosting provider, you may see that the allocated memmory is 128mb but maybe the server configuration block's it.

Regards
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 28, 2012, 02:40:48 AM
Quote from: bytelord on November 28, 2012, 01:21:42 AM
...please contact your hosting provider, you may see that the allocated memmory is 128mb but maybe the server configuration block's it.
My hosting company reports that memory_limit is set to 256M, so there's no blockage on that score.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 28, 2012, 04:34:31 AM
Sorry i don't have another answer on that, the only i can think is related to PHP or any joomla issue.
Did you try with localhost?
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 28, 2012, 22:38:36 PM
Quote from: bytelord on November 28, 2012, 04:34:31 AM
Did you try with localhost?
I took another run at the problem today. With the caches of my browsers cleared, I can get to my site's VirtueMart pages if the VirtueMart SEO and the Joomla SEF URLs are both disabled. When I enabled those options, VirtueMart gives me the same type of Fatal Errors as noted above.

I moved the site to my local XAMPP. Of course, everything works fine there.

Back at my own server, I reverted from VirtueMart version 2.0.14 to VirtueMart version 2.0.13a (also reported as 2.0.12g). The site now works well with no Fatal Errors with and without SEF/SEO enabled. Apparently something broke in the move from 2.0.13a to 2.0.14.

I can use 2.0.14 without SEF/SEO or version 2.0.13a with SEF/SEO.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 28, 2012, 23:11:00 PM
Hello,

I don't thing something is broke, router just have some new changes but is not causing the issue. Out of memory is related to PHP and as you said you have PHP5.3+. May be the the other vm version doesn't go over 29mb when you testing, just luck.
If is working just fine locally why on your live server causes issues? Is not related to vm/joomla. I still think is a PHP issue. Please ask your provider.

Regards
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 28, 2012, 23:48:34 PM
Quote from: bytelord on November 28, 2012, 23:11:00 PM
I don't thing something is broke, router just have some new changes but is not causing the issue. Out of memory is related to PHP and as you said you have PHP5.3+.

I forgot to mention that my XAMPP is at PHP version 5.4.4. My ISP is at 5.3.x.

QuoteMay be the the other vm version doesn't go over 29mb when you testing, just luck.
If is working just fine locally why on your live server causes issues? Is not related to vm/joomla. I still think is a PHP issue. Please ask your provider.

They say that my memory limit is 256 megabytes.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 29, 2012, 02:49:59 AM
I don't know really.
All my PHP installations with joomla 2.5 and vm2 are PHP 5.3.x, you shouldn't have issues with that. Do you any other host to test your site also there?
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 29, 2012, 03:06:04 AM
Quote from: bytelord on November 29, 2012, 02:49:59 AM
Do you any other host to test your site also there?
Now that you mention it, I could temporarily load the site on to one of my client's account. In fact, the site under development is destined for a different host in a week or two.

I have another client running VirtueMart at version 2.0.12f on still another host. I can put a copy of his site on a subdomain, move it to 2.0.14 and see what happens.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 29, 2012, 03:16:56 AM
Yes you can place it on a subdomain or subfolder. Use akeeba backup to backup and restore to the new location.
Remember to check the configuration on the new url (joomla live site, etc)

Regards
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 29, 2012, 03:23:12 AM
Quote from: bytelord on November 29, 2012, 03:16:56 AM
Yes you can place it on a subdomain or subfolder. Use akeeba backup to backup and restore to the new location.
Minutes ago I moved one of my client's sites from PHP 5.2 to version 5.3 just to keep Akeeba happy.

If you know what you are doing and have lived a clean and wholesome life, with Akeeba (and Kickstart), you can rule the world.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 29, 2012, 03:34:03 AM
Yes, is a great tool.

Keep in mind joomla 2.5 works better with php 5.3, the same with vm2.

Regards
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 29, 2012, 22:46:40 PM
Quote from: bytelord on November 29, 2012, 02:49:59 AM
Do you any other host to test your site also there?
I copied the troublesome site over to a different host. It will come as no surprise to you that the VirtueMart pages worked fine. My own host claims that there will be no problems if the memory use remains below 256 megabytes. Obviously that's not the case because the error always appears at 29.6 megabytes. Now I just have to get them to repair the misconfiguration.
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 29, 2012, 23:39:08 PM
Hello,

Yes i think the override that price and block your php memory site limit ... hopefully they fix it

Regards
Title: Re: Out of Memory Error Apparently Related to SEO
Post by: cmb on November 30, 2012, 03:07:45 AM
My host responded with, The server's php limit is set to 256MB, not 128 MB or 28 MB that your script is reporting. Please double check the script's setting to make sure there is no internal memory limit setup on the configuration.

I persisted, pointing out that the reported setting for the site in question was 128 MB. Whatever erroneous value was stuck in that site's configuration file was flushed out when they finally reset it to 256 MB.

At last I can bring VirtueMart up to version 2.0.14 without having it blow up in my face.
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 30, 2012, 03:48:37 AM
Hello,

So it is working now? Probably the 128mb of memory is shared around the installed nodes or the didn't restart apache last time they increase it :)

but in any case try to search your source code (just saying) if any extension sets the limit from the script as your host provider mention, but i don't think that a joomla extension will reduce the php memory size

btw, the code is ini_set('memory_limit', '128M');

try to search inside the code for ini_set('memory_limit'

just in case...

Regards
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: cmb on November 30, 2012, 04:46:12 AM
Quote from: bytelord on November 30, 2012, 03:48:37 AM
So it is working now?
It's doing fine and I've marked this thread as Solved.
QuoteProbably the 128mb of memory is shared around the installed nodes or the didn't restart apache last time they increase it...
My host was once great but in the last six months they've botched a few things up. I no longer recommend them to my clients.
Quote...but in any case try to search your source code (just saying) if any extension sets the limit from the script as your host provider mention, but i don't think that a joomla extension will reduce the php memory size... try to search inside the code for ini_set('memory_limit'
Sometimes there's a space just inside the left parentheses. I didn't write a regular expression search. I just searched for the memory_limit part in the entire Joomla/VirtueMart directory structure. I found a few instances.

At line 56 of \administrator\components\com_virtuemart\helpers\migrator.php:
if($memory_limit<128)  @ini_set( 'memory_limit', '128M' );
so that's benign. The same line appears at line 49 of \administrator\components\com_virtuemart\helpers\tableupdater.php and line 20 of \administrator\components\com_virtuemart_allinone\script.vmallinone.php.

Line 59 of \components\com_virtuemart\views\orders\view.html.php is:
if($memory_limit<40)  @ini_set( 'memory_limit', '40M' );
Again, no problem.

Line 13 of \administrator\components\com_virtuemart\install\script.virtuemart.php has:
@ini_set( 'memory_limit', '32M' );
Why that's there without a conditional statement if front of it, I have no idea. I hope the memory limit gets reset to a higher value soon after that.
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 30, 2012, 16:20:34 PM
Hello cmb,

No problem, all this running during installation/update/migration ... as you notice also of course.

So, is your host after! Glad you solved, sometimes the host providers reply's back without checking / validating the issue ...

Regards
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: cmb on November 30, 2012, 18:56:58 PM
Quote from: bytelord on November 30, 2012, 16:20:34 PM
...sometimes the host providers reply's back without checking / validating the issue ...
I invariably get better service from my hosting when I'm dealing with the owner. His underlings often have a more perfunctory attitude. They read from the script and strive to clear trouble tickets as quickly as possible.
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: bytelord on November 30, 2012, 19:29:48 PM
Is the reason why i am running my own server hosted in a uk datacenter ... :)
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: cmb on November 30, 2012, 19:46:16 PM
Quote from: bytelord on November 30, 2012, 19:29:48 PM
Is the reason why i am running my own server hosted in a uk datacenter ... :)
I'm moving in that direction too. So far, though, I've only begun some experiments with an Oracle VM VirtualBox on my own computer.
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: Milbo on December 17, 2012, 19:56:41 PM
Quote from: cmb on November 28, 2012, 22:38:36 PM
Apparently something broke in the move from 2.0.13a to 2.0.14.

I can use 2.0.14 without SEF/SEO or version 2.0.13a with SEF/SEO.


Yes, we moved caching into the RAM. Our experience is that using more RAM to save calculation time is in most cases desired.

Quote from: cmb on November 30, 2012, 04:46:12 AM

Line 13 of \administrator\components\com_virtuemart\install\script.virtuemart.php has:
@ini_set( 'memory_limit', '32M' );
Why that's there without a conditional statement if front of it, I have no idea. I hope the memory limit gets reset to a higher value soon after that.


Thanks for finding this. in the new version I will add a standard function ensuring a set memory limit for special operations.
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: cmb on December 17, 2012, 20:12:44 PM
Quote from: Milbo on December 17, 2012, 19:56:41 PM
Yes, we moved caching into the RAM. Our experience is that using more RAM to save calculation time is in most cases desired.
Does that mean that VirtueMart is chewing up my RAM even if I have all caching disabled?

On a related note, I'm still getting fatal out of memory errors at about 30 megabytes even though my maximum memory limit is set to 256 megabytes. It doesn't happen all the time. Usually an administrator has to be logged into the site. If a visitor to the front end then selects a VirtueMart page, they will often, but not always, see the fatal error. No other pages on the site are affected.

I have reloaded Joomla, jEvents, VirtueMart and numerous other extensions. It now appears that disabling URL Rewriting allows the visitor to see the VirtueMart pages without errors. The analysis continues.
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: bytelord on December 17, 2012, 20:14:34 PM
@cmb

I think this was related to your provider PHP memory size settings, cause as you test it local and on another server you didn't have this issue ... you could change this line to 128 or 256mb but will not affect it as you said previously.
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: cmb on December 17, 2012, 20:22:46 PM
Quote from: bytelord on December 17, 2012, 20:14:34 PM
I think this was related to your provider PHP memory size settings, cause as you test it local and on another server you didn't have this issue...
It may be that I didn't test it extensively enough on the other servers. I noticed recently that an administrator has to be logged in for the out of memory condition to be reached. It also doesn't happen all the time. I haven't yet pinned down all the conditions required. So far, disabling URL Rewriting seems to be the solution but not all the evidence is in. I'll leave URL Rewriting disabled for now and see if the fatal error reappears. Too many variables.
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: bytelord on December 17, 2012, 20:52:48 PM
This is something else, but as more functions your are using, more memory is needed (like making Apache changes or using sef), also when connecting as administrator more "stuff" is been loaded. As i told you, imho, this is related to your hosting provider, may be finally they increased your memory limit for PHP, but, does your box/account have enough memory?? If for example your node haves 256 memory for the whole node how to able to increase your php memory size up to 256? only Apache needs 128mb at least.  Check your memory consumption on your box if your provider lets you do it.

But anyway, if you are sure that is not related to your hosting provider, that's fine for me.

Regards
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: cmb on December 17, 2012, 21:44:13 PM
Quote from: bytelord on December 17, 2012, 20:52:48 PM
...imho, this is related to your hosting provider, may be finally they increased your memory limit for PHP, but, does your box/account have enough memory??
That's unknown. The report from PHP Info is that I have 256 megabytes available. The error occurs intermittently if I try to allocate any more than 30 megabytes. There is 226 megabytes of memory unaccounted for and in use by some anonymous processes.
QuoteIf for example your node haves 256 memory for the whole node how to able to increase your php memory size up to 256? only Apache needs 128mb at least.  Check your memory consumption on your box if your provider lets you do it.
Unfortunately, I cannot determine the total box memory allocation. Also, the error messages are not detailed and the Fatal Error - Out of Memory messages are not even logged.
Quote...if you are sure that is not related to your hosting provider, that's fine for me.
At this point, I suspect some anomaly in my hosting provider's configuration but the evidence is not conclusive. I can't make it fail consistently. So far it only appears when a VirtueMart page is called and then only intermittently.
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: bytelord on December 17, 2012, 22:07:12 PM
It comes in some vm2 pages because uses more memory and that because access the database, make calulations, etc ... If it stops then is related either to your htaccess (php.ini in other cases that have access to it) file configuration or your hosting provider. Please make a test with another provider or request more memory for your node ... is a vps node? shared hosting account? A cheap hosting?

Regards
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: cmb on December 17, 2012, 22:16:51 PM
Quote from: bytelord on December 17, 2012, 22:07:12 PM
Please make a test with another provider or request more memory for your node ... is a vps node? shared hosting account? A cheap hosting?
The Website in question is under development and will be moved to my client's hosting account within a few weeks.
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: balai on December 18, 2012, 10:23:01 AM
Hi

I have encounter similar problems with some hostings.
Could you please refer your hosting company to check if its the same?
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: Milbo on December 18, 2012, 12:58:32 PM
I am also interested in your the amount of products and categories you have.
Title: Re: [Solved] Out of Memory Error Apparently Related to SEO
Post by: cmb on December 18, 2012, 20:16:26 PM
Quote from: balai on December 18, 2012, 10:23:01 AM
Could you please refer your hosting company to check if its the same?
Answered privately. There's no need to disparage my hosting company yet.
Quote from: Milbo on December 18, 2012, 12:58:32 PM
I am also interested in your the amount of products and categories you have.
The site in question has fifteen products in two categories. There are no custom fields and no child products. There is one manufacturer, a no shipping module and a PayPal payment module. There are just the anonymous and default shopper groups.