Hot answers tagged

6

You probably need to up Craft's internal memory limit, as well – the following should go into the array in your general.php configuration file: 'phpMaxMemoryLimit' => '1024M',


6

OK, finally answering my own question here as it seems to not be an issue with the latest Craft 2.5 builds when devMode is turned off, but is still an issue when devMode is on. As far as I can tell its something to do with the Craft logging tool spiralling out of control, but thats as far as I got.


5

Most likely you'll need to add this line to the Craft config file (craft/config/general.php)... 'phpMaxMemoryLimit' => '512M', Craft 2 docs Craft 3 docs


4

If you enable devMode, then memory usage, along with tons of other debugging information (# of database queries, query profiles, execution timestamps, etc.) will be output to your browser's console.


4

While Craft appears to give you a success message when the Update Asset Index modal displays a pretty checkbox, when working with a large number of assets, if you don't see a loading bar appear or see the indexed assets afterwards, it's possible you are running into a memory issue, and that pretty checkbox is lying. Likely, if you look at your craft/storage/...


3

Use .total() instead of .count() .count() will query the db and fetch all fields for all items relating to your criteria and then count them. .total() only counts the number of items your criteria returns without all of their fields.


2

I think this is difficult to answer properly because it depends almost entirely on what the tasks and subtasks are actually doing. For example, the main task could do something that ate 400MB of memory and triggered 400 sub-tasks that did nothing but return null not using any memory. Alternatively, the main task could do nothing but trigger subtasks (using ...


2

Read some pages in the craft docs that Brad linked to get to know the basic structure where to place your files Go to Pluginfactory and create a plugin, you only have to check the "Variables" light switch to generate a PluginNameVariables file Download the files and place them in your craft/app/>>pluginHandle<< folder like it is stated in the ...


2

Assuming you're referring to Craft 2, the EntryModels that get returned to a template do have a significant memory overhead attached to them you're probably running into. Doing the math, even bumping your php.ini memory_limit up to 256M is only going to get your around 260 results coming back with your given fields/configuration. It's one of the big things ...


1

Sounds like you don't have the correct PHP loading in your CLI. You should try using MAMP’s PHP Executable in your Terminal.


1

This should be fixed for the upcoming 3.2.11 release. To get the fix early, change your craftcms/cms requirement in composer.json to: "require": { "craftcms/cms": "dev-develop#87fd6ca6b0c57f524c8ccae895c13eb9724d0efa as 3.2.10", "...": "..." } Then run composer update.


1

You don't mention if it's Crat 2 or Craft 3, but I'm not seeing anything in either codebase where Craft (or Yii) would limit the amount of memory available in its caching classes.


1

Ok, update.. The problem of my high memory usage was caused by (I think the logging of) devmode.. When I set devmode to false the moment that hit 10+gig memory before now has 100mb of memory usage... Resetting memory on the different tasks that get initiated in the same function or as subtasks is not possible I guess?


1

I sent the Craft 2 database to Pixel and Tonic, and Brad kindly updated it for me.


1

Just to record for others getting this error when adding Locales, I ran into this on Step 1 when ResaveElements for Assets. Seems that there were some entries in craft_assetfiles that no longer existed and caused the task to halt. Managed to debug by checking the step number in craft_tasks, then looking for a row at that position in assetfiles that equated ...


1

Had the same issue. In my case there was no phperrors.log (according to Brandon, it will only exist if there have been any fatal PHP errors) The error was instead logged to storage/logs/web.log, but even easier, you can view the error in the CP. Craft (as of version 3.0.12) does not show it to the user (hopefully that will change, see https://github.com/...


1

I had this same issue with an image-heavy site hosted on WebFaction w/ PHP5.6, using latest Craft 2.6.x version. I added the fix Brad mentions + another config line: // From http://stackoverflow.com/a/12835966 // Pixel cache max size $this->setResourceLimit(\Imagick::RESOURCETYPE_MEMORY, 256); // Maximum amount of memory map to allocate for the pixel ...


Only top voted, non community-wiki answers of a minimum length are eligible