Re: free allocated memory: HOW ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



answering Jochem:

> WTF - 386 megs for an html file??? somehow I doubt this is
> the correct number ... are you reading the memory consumption
> correctly?

when the newsletter generation starts memory_get_usage() says ~96 MB in use. So approx 290 megs more are used after reading the 20.7 Kb template with fread()! I am reading the memory consumption with memory_get_usage(), so I dont know what should be wrong with that...

> exactly how much ram does the server in question have that you can
> allow a single script to schlock up almost 2gigs ??

dev machine 4 GB, webserver 8 GB of RAM

> if the values are customized I can't fathom why you would generate
> 100 emails per loop.

sorry, my fault, I meant I am generating 100 emails "once", sleep(2), then the next 100, and so on... In my case (50xx mails - that results in 51 "loops" a 100 mails).


answering TG:

Couple of questions come to mind...

1. How big is this template that you're loading? Not sure why almost any HTML file would take up 300+ meg of memory when loaded into a variable.  Are you loading images and other content in as well or just the HTML file?

the size of the template is 20.7 Kb


2. Replacing the placeholders with actual data increases memory that much?  Damn.. maybe I'm just ignorant of how PHP maintains things in memory, but that seems kind of nuts too

3. Do you have to store each newsletter in memory at each loop or can you send them out then move to the next one without storing them in an array or whatever you're doing?

I write each newsletter to a mysql database then move to the next


4. Please tell us these 'newsletters' don't contain information on "male enhancement products" or "govt seized puppies"..hah

No, they don't ;)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux