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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:43:45+00:00 2026-05-17T22:43:45+00:00

I currently have a PHP CLI script using Zend Framework extensively which seems to

  • 0

I currently have a PHP CLI script using Zend Framework extensively which seems to be using a ever larger amount of memory as it runs. It loops through a large set of models retrieved from a database in batches of 1000. Calls to memory_get_usage() show that the memory usage of the script is always increasing.

This is despite making sure that I’m unsetting the model after every iteration and actually using array_shift() to reduce the size of the array of models on every iteration.

My question is, in PHP is there a way of discovering the size-in-memory of a variable so I can track what’s growing?

  • 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-17T22:43:45+00:00Added an answer on May 17, 2026 at 10:43 pm

    i don’t have a solution to check the size of every variable, but if you use doctrine its probably the reason

    you need to use

       $Elem->free(true);
    

    another thing is to upgrade to 5.3 (if you dont do it yet), the garbage collector of 5.3 is better

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

Sidebar

Related Questions

I currently have a web server running PHP 5.2.13 and have recently been told:
I currently have 3 controllers, AdministratorController.php , ResellerController.php and ServiceProviderController.php . Each of these
I currently have a sh script: location=$1 imageNumber=$2 keyword=$3 page=$4 imagesInPage=$5 imagesToGet=$6 imageUrls=`curl -s
I currently have a script ready that resizes a whole image with GD but
I currently have more than 1000 visits / day and hosting at 1and1 with
I currently have some VERY long winded code for the menu I use on
I currently have a Joomla 1.5 installation, as well as another website. They both
I currently have a report that give me the users ID number and their
I need some jQuery ajax help. I currently have a main content div that
Good evening, here is what I am trying to achieve, I currently have a

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.