Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8916319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:12:52+00:00 2026-06-15T05:12:52+00:00

I am creating a website in the CMS/framework called Processwire now I do want

  • 0

I am creating a website in the CMS/framework called Processwire now I do want to fill a few arrays with values i collected from database results (called pages in processwire).
Now what happens is that i get a memory error and I know that i should raise the memory limit but that doesn’t feel right because the pages will even get more and more then it is already therefor the load will get bigger and i might end up increasing the memory limit even more. Now I would like kind of pick batches from the big pile and process them and then pick the next batch.
this is the part that causes to crash:

    for($i = 0; $i<=$count_log; $i+=100)
{
    $all_log_files = $pages->find("template=logs, start=$i, limit=100");
    foreach($all_log_files as $log_file)
    {
        $u++;
        if(empty($actions["$log_file->action"]))
        {
            $actions[$log_file->action] = 1;
        }
        if(empty($ips["$log_file->ip"]))
        {
            $ips[$log_file->ip] = 1;
        }
        if(empty($values["$log_file->value"]))
        {
            $values[$log_file->value] = 1;
        }
        if(empty($results["$log_file->result"]))
        {
            $results[$log_file->result] = 1;
        }
    }
}

Now as you can see i already tried to make “batches” but I failed since i’d still get the error…

What can i do this fix this or isn’t there anything i can do and should i just raise the memory limit?

EDIT:

The specific error:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 6 bytes) in /xxx/xxx/xxx/xxx/wire/core/DatabaseQuery.php on line 47

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:12:53+00:00Added an answer on June 15, 2026 at 5:12 am

    You’re having a memory issue because the data that you’re trying to store in memory all at once is too big. You can either increase the memory limit to hold all the data or store less data and change your algorithms to work with batches of the data.

    For example, if you have a function that uses the values stored in $results, then you can try to change this function to work just as well with only part of the results, and call the function for each iteration, then empty the array after the iteration finishes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a basic CMS website using Alfresco Web Quick Start. I want
I want to use some ASP.NET based CMS for creating my website and don't
I am working on creating website with Yii framework and I have a problem
I am creating a website. It has a database and I'm trying to work
I'm creating a website and I want it also to be prepare for mobile
I am creating a website without use of CMS...I have used Joomla before and
I'm a desktop application developer. I'm creating a basic website from which to sell
I am attemptting to attach a small CMS to a website I am creating.
I am working on PHPmotion video cms website. I want to create API to
After dynamically creating a client-side table based on SELECT information retrieved from MySql database,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.