0

I happen to run a php script and i encountered the following error:

Fatal error: Out of memory (allocated 1820327936) (tried to allocate 33554432 bytes) in C:\xampp\htdocs\interim3\Includes\Controller\db_querystatements.php on line 84

in my db_querystatements.php i have set the memory limit to unlimited ini_set('memory_limit', '-1');

the error point to the following codes:

function dbQueryAclLocalPort(){
$db_data = new PDO ('sqlite:././Database/information.sqlite');
$result_data = $db_data->query('SELECT local_port from attacked_acl');

    foreach ($result_data as $row_data)
    {
    $acllocalport[] = $row_data['local_port'];
    }

    return $acllocalport;
}

function dbQueryAclLocalHost(){
$db_data = new PDO ('sqlite:././Database/information.sqlite');
$result_data = $db_data->query('SELECT local_host from attacked_acl');

    foreach ($result_data as $row_data)
    {
    $acllocalhost[] = $row_data['local_host'];
    }

    return $acllocalhost;
}

any advise? thanks

8
  • This means you've somehow triggered a memory leak. Please include the code from your affected scripts so we can point out to you what's causing the problem. Commented Sep 5, 2011 at 7:02
  • How many rows are you dealing with? Commented Sep 5, 2011 at 7:05
  • quite a lot. probably over 100+ Commented Sep 5, 2011 at 7:07
  • 1
    over 100 is not quite a lot. unless you'r storing full length movies in your database Commented Sep 5, 2011 at 7:27
  • actually to be exact is over 4000 over pages of results. each of this result shows over 20 rows and 6-7 columns Commented Sep 5, 2011 at 7:33

1 Answer 1

2

Your script seems to be using 1.8 GB of memory. It seems to be hitting the system's physical limit.

Try to reduce your script's memory usage or fix the memory leak that is causing this.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.