Fatal error: Allowed memory size...

13 posts by 3 authors in: Forums > CMS Builder
Last Post: June 7, 2010   (RSS)

Re: [eduran582] Fatal error: Allowed memory size...

By Jason - May 14, 2010

Hi,

Could you provide a link to where you're having the trouble so I can take a look?

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Fatal error: Allowed memory size...

By eduran582 - May 14, 2010

Thanks for answering, Jason. Can I have your email address so I can send the information?

Re: [eduran582] Fatal error: Allowed memory size...

By Jason - May 14, 2010

jason@interactivetools.com
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [eduran582] Fatal error: Allowed memory size...

By Jason - May 17, 2010

Hi,

I located our problem.

The function getRecords has an option called 'loadCreatedBy'. This loads a record from the User Accounts table for each record returned. By default, this is set to on. Since we're loading so many records, I changed the option to off:

'loadCreatedBy' =>false,

This seems to have taken care of the problem.

Let me know if you run into any more issues.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Fatal error: Allowed memory size...

By eduran582 - May 19, 2010

Thanks, Jason. That did the trick! A good option to know when working with a bunch of records!

Re: [Jason] Fatal error: Allowed memory size...

By mark99 - May 19, 2010

What sort of things is that function needed for? I mean, is it something many of us could disable to improve performance (assuming some of our pages might not need it)?

Re: [mark99] Fatal error: Allowed memory size...

By Jason - May 19, 2010

Hi Mark,

This just pulls in information from the user account table for the person who created an individual record. You could always turn it off for pages that don't require this information.

You may not really see any change in performance since the number of records most pages return is fairly small. The only reason it was an issue in this case is that the page was returning well over 12,000 records.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Fatal error: Allowed memory size...

By mark99 - May 20, 2010 - edited: May 20, 2010

I don't need it so would still like to remove it on my output pages (I always think it's a good idea to disable anything you don't absolutely need hehe).

Do I assume that to do this you'd just add the line like so..

<?php

require_once "lib/viewer_functions.php";

list($isp_listRecords, $isp_listMetaData) = getRecords(array(
'tableName' => 'isp_list',
'perPage' => '3',
'loadCreatedBy' => 'false',
));
?>


Or must it be 'loadCreatedBy' => false, without the ' character?

Re: [mark99] Fatal error: Allowed memory size...

By Jason - May 20, 2010

Hi Mark,

You should leave out the ' ', so it would look like this:

<?php

require_once "lib/viewer_functions.php";

list($isp_listRecords, $isp_listMetaData) = getRecords(array(
'tableName' => 'isp_list',
'perPage' => '3',
'loadCreatedBy' => false,
));
?>


That should do it. Let me know if you run into any issues.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/