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

  • Home
  • SEARCH
  • 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 6775559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:55:15+00:00 2026-05-26T15:55:15+00:00

I have a new challenge today. I will develop a script that will take

  • 0

I have a new challenge today. I will develop a script that will take some large data_log (fopen) and insert it into a database. Yesterday I did my first tests, and I estimate that this script will need a week running to process the log.

I made some env configs, like set_time_limit and set_memory_limit.

But, in this first test after an while (15min), the app crashes. The machine was running in 2gb memory usage when it crashes.

The msg error:

PHP Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y) in whatever.php

Please keep in mind that the script/code is ok.

  • 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-05-26T15:55:16+00:00Added an answer on May 26, 2026 at 3:55 pm

    The script code isn’t ok. You aren’t timing out, you’re simply running out of memory to store whatever data you are loading from the log file.

    Without seeing the code or knowing the context, you should look at the following options.

    1. Clean up after yourself so you don’t use more and more memory. If you’re reading/writing data from or to a file, make sure you clear what data is in the memory every once in a while (depends on the loop)

    2. Modify the script to work with chunks of data. Make the script run every minute or so and make it shut down after you’ve worked with a portion of the data. This will keep the memory requirement low and you also don’t have a continuously running script (easy to continue from where you stopped)

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

Sidebar

Related Questions

I have here a challenge that I spent some time addressing. Selenium tells me
When we have new in C#, that personally I see only as a workaround
We have a new application that requires glibc 2.4 (from gcc 4.1). The machine
I just found myself a new challenge: Make a Word Processor that is in
I'm a little new to objective-C but have run across a problem that I
I'm about to take a challenge test so I don't have to take a
I have this new challenge to load ~100M rows from an Oracle database and
I have a challenge I need some input on. I am currently recruiting programmers
One challenge using hibernate is that manged classes have to have a default constructor
I have some data that I want to delete and I want to use

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.