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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:15:54+00:00 2026-05-31T00:15:54+00:00

My PHP memory_limit is 64M (which is pretty high to start with) I have

  • 0

My PHP memory_limit is 64M (which is pretty high to start with)

I have a MongoCollection::findOne() called in my PHP code where I “find one” by MongoId.
It works in most cases. However in some cases, it causes PHP to go over the memory_limit of 64M.

The data record in Mongo is at max, 3.5MB because Mongo does not allow more than 4MB.

When I run, memory_get_usage() before calling findOne(), its only about 4MB. So findOne() seems to have consumed the other 60MB+. Is this a memory leak or is there a design flaw in the way I store in Mongo?

My PHP Mongo driver is the latest 1.26

  • 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-31T00:15:56+00:00Added an answer on May 31, 2026 at 12:15 am

    It would be helpful if you could post the exact code that you are running. It is most likely your code, but there is a chance that it could be a bug with the Mongo PHP drivers. The latest version of the drivers (1.2.9) seems to be a step backwards from previous versions. I myself found a bug in the driver that causes php to segfault on connection timeouts 😮 In a conversation that I had with a 10gen developer it was revealed to me that the php drivers are the least mature of all the languages, but I was told that they just hired a php developer so the drivers should be getting some love soon.

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

Sidebar

Related Questions

My htaccess have this code # # Apache/PHP settings: # Options -Indexes Options +FollowSymLinks
I specify this question for PHP source code, where I have a source code
I have the following in php: public function myfunction($v){ //ini_set(memory_limit,32M); $v=mysqli_real_escape_string($this->connection,$v); $stmt=mysqli_prepare($this->connection,SELECT * from
I am currently debugging a php-script. I set the memory_limit to 64M and it
I am using TimThumb at http://www.darrenhoyt.com/2008/04/02/timthumb-php-script-released/ . I have adjusted the memory_limit to 5000MB
I have a small question, when we set the memory_limit for PHP I understand
How to find memory used by an object in PHP? (c's sizeof). The object
I have several static factory patterns in my PHP library. However, memory footprint is
PHP has a great function called htmlspecialcharacters() where you pass it a string and
I am doing a file upload using PHP, which works fine for a file

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.