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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:55:12+00:00 2026-05-25T23:55:12+00:00

I have a php script that uses Doctrine2 and Zend to calculate some things

  • 0

I have a php script that uses Doctrine2 and Zend to calculate some things from a database and send some emails for 30.000 users.

My script is leaking memory and I want to know which are the objects that are consuming that memory, and if it is possible who is keeping a reference to them (thus not allowing them to be released).

Im using php 5.3.x, so plain circular references shouldn’t be the problem.

Ive tried using xdebug trace capabilities to get mem_delta with no success (too much data).

Ive tried manually adding memory_get_usage before and after the important functions. But the only conclusion that I got was that I loose around 400k per user, and 3000 users times that gives me the 1Gb that i have available.

Are there any other ways to know where and why memory is leaking?
Thanks

  • 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-25T23:55:12+00:00Added an answer on May 25, 2026 at 11:55 pm

    You could try sending say 10 emails and then inserting this

    get_defined_vars();
    

    http://nz.php.net/manual/en/function.get-defined-vars.php

    At the end of the script or after the email is sent (depending on how your code is setup).

    This should tell you what is still loaded, and what you can unset / turn into a reference.

    Also if there are two many things loaded you get this near start and end of your code and work out the difference.

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

Sidebar

Related Questions

I have a script that uses PHP mail() function to send emails: mail(me@mydomain.com, Subject,
I have a php script that uses some css/javascript tabs, they work on my
I have a PHP script that uses CURL to fetch a remote page and
I have a PHP script that does the following: Uses file_get_contents() to get content
I have developed a PHP script that uses $_REQUEST[] superglobal. A typical client request
I have a CGI script that uses an old database driver that is no
I have a PHP program that uses a Bash script to convert a pdf.
I have a php script that sends an email. It currently uses the php
I have a php script that triggers some magento actions, and I set it
I have a PHP script that uses GD2 to create an image. It uses

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.