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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:30:28+00:00 2026-05-16T11:30:28+00:00

I have a small question, when we set the memory_limit for PHP I understand

  • 0

I have a small question, when we set the memory_limit for PHP I understand that it will use that integer as the maximum memory allowed for a script to consume.

Does this mean if I set the maximum at 64MB and my script only needs 12MB that it will make use of the full 64MB just because its allowed?

I ask because I notice some of my scripts although make use of 12MB (found out using get_memory_usage) but the httpd process itself is getting near the 64MB mark even though that is the only script running! Btw, I am not having a memory leak issue.

Is it also the case that other process it spawns i.e. CMD will be added to the httpd processes overall memory usage?

Thanks all for any help on clearing this up for me.

  • 1 1 Answer
  • 2 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-16T11:30:28+00:00Added an answer on May 16, 2026 at 11:30 am

    PHP’s memory_limit only takes memory into account that is handled by the Zend Engine’s memory manger (see Zend/zend_alloc.c) and this manager does not allocate the amount set via memory_limit “pre-emptively” (though it allocates new memory in segments). Not everything “within” PHP is handled by the memory manager, but the majority is. Other processes spawned by your instance of php do not “inherit” the memory manager. Therefore their memory consumption does not count against memory_limit.

    What you saw in the task manager is (most likely) the working set of the httpd process. That includes the memory allocated by php (handled by the memory manager or not) if it is installed as an apache module. But also anything else of the httpd that is currently in physical memory. But it does not include the amount of memory allocated by spawned processes.

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

Sidebar

Related Questions

hello I have a small question in objective-C memory management. I know that if
A little back story : I have small application that will use Word to
I have a small question about static variable and TypeObjects. I use the API
I have a small question about structures with the LayoutKind.Explicit attribute set. I declared
I have a small question hoping someone will help me. Is there any way
I have a small method I use to disable my socket that listens for
I just have a small question that I would like some clarification about, if
I have a small application with a CheckBox option that the user can set
I have small question by entity framework 4.1. There is interface of image DTO:
I have small question. When I started to programm my application, I grouped types

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.