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 6714287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:28:40+00:00 2026-05-26T08:28:40+00:00

My Apache gets killed sometimes because it runs out of memory. This did not

  • 0

My Apache gets killed sometimes because it runs out of memory. This did not use to happen. I have several hundred PHP files in this project.

I suspect that there was an unintentional recursion created — not just a function calling itself, but function A calling B which then calls A again.

I’ve tried just reading the code and finding such recursion, but with no luck.

Is there a way I can tell PHP to keep track of ALL recursions, or throw a warning when its internal stack is over a certain size?

  • 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-26T08:28:41+00:00Added an answer on May 26, 2026 at 8:28 am

    My Apache gets killed sometimes because it runs out of memory.

    Well that’s at least a point to start with. I could read in your question you suspect that is caused by a PHP script.

    To find out which one, you need to look further. One way I could think of is that you enable PHP error logging. Then set the memory_limit to a low value so you can provoke errors where much memory consumption happens. You find the line where this happens in the error log (see as well Protocol of some PHP Memory Stretching Fun).

    This should give you some potential places.

    I’m not specifically sure if recursion must cause this and you wrote yourself that you only assume that. To detect recursion, you can use xdebug and limit recursion depth:

    xdebug.max_nesting_level=<your preferred value>
    

    This should give you as well more useful information in the error logs.

    If both memory and recursion is not the case, it might either not be related to PHP or PHP segaults and your webserver can’t handle that situation. No idea how mod_php deals with segfaults for example but you haven’t specified the SAPI you’re using anyway.

    A typical source of PHP segfaults however are regular expressions that kick out PHP before triggering the pcre recursion limit. If you’re making use of regular expressions in your code, you can just reduce the recursion limit to a lower value like and test if that helps. However, from your question it’s not clear if that is a cause at all. So you first need to find out more.

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

Sidebar

Related Questions

I have this Apache Felix activator which gets data source service: import javax.sql.DataSource; import
My Apache server works fine without -DSSL, but does not start with SSL. This
On my Apache server I have a PHP service that gets requests and generates
I am using Apache Solr for search. I use this to provide personal user-based
I am using apache on Centos and whenever I use domain.com it gets redirected
I have a web app that runs perfectly on Apache Tomcat. However, when I
I'm running a java code using Apache Avro. Some code gets deprecated in the
In my Apache server I want to make this redirection : everything that comes
We have a Django app running on apache server (mod_python) on a windows machine
Is it possible to have Apache htaccess rewrites take effect before it hits django?

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.