Re: [PHP] free allocated memory: HOW ?

2007-04-15 Thread Chris
Richard Lynch wrote: On Fri, April 13, 2007 12:54 am, Arthur Erdös wrote: It can if you're trying to process a borked image... I've had imagecreatefromjpeg() eat memory up to almost 50x the size of the image before finally deciding it can't handle it and crapping out. That was *after* running i

Re: [PHP] free allocated memory: HOW ?

2007-04-13 Thread Richard Lynch
On Fri, April 13, 2007 12:49 am, Arthur Erdös wrote: > $abonents = $personAction->findAbonents($start, > $offset); > $size = $personAction->countFoundRows(); > $this->logger->debug("Found " . $size . " > abonents"); >

Re: [PHP] free allocated memory: HOW ?

2007-04-13 Thread Richard Lynch
On Fri, April 13, 2007 12:54 am, Arthur Erdös wrote: >>> It can if you're trying to process a borked image... >>> >>> I've had imagecreatefromjpeg() eat memory up to almost 50x the size >>> of >>> the image before finally deciding it can't handle it and crapping >>> out. >>> That was *after* runnin

Re: [PHP] free allocated memory: HOW ?

2007-04-13 Thread Jochem Maas
Roman Neuhauser wrote: > # [EMAIL PROTECTED] / 2007-04-12 18:17:34 +0200: >> 3-4 seconds is dead slow if you ask me - a script like this should be >> capable of >> making the average mailserver go completely apeshit assuming you'd be >> mailing the >> newsletters out directly after creating them

Re: [PHP] free allocated memory: HOW ?

2007-04-13 Thread Arthur Erdös
> Reading in the template should only happen once and take roughly as much > memory as the file is big. > > If the file is 20k, memory should go up roughly by that much. > > If it's going up a lot more, something is going wrong (either you're > doing something wrong or you're not just reading t

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Chris
Arthur Erdös wrote: Am Freitag, den 13.04.2007, 16:03 +1000 schrieb Chris: ok, the complete workflow is a little bit complicated. we are using a workflow engine and the newsletter generator is one step of three. the first cleans the statistics data, the second generates the new data and the thir

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-04-13 07:49:43 +0200: > > > Just post your source already. > > > > ok, the complete workflow is a little bit complicated. we are using a > workflow engine and the newsletter generator is one step of three. the > first cleans the statistics data, the second generates th

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
Am Freitag, den 13.04.2007, 16:03 +1000 schrieb Chris: > > ok, the complete workflow is a little bit complicated. we are using a > > workflow engine and the newsletter generator is one step of three. the > > first cleans the statistics data, the second generates the new data and > > the third is th

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-04-12 18:17:34 +0200: > 3-4 seconds is dead slow if you ask me - a script like this should be capable > of > making the average mailserver go completely apeshit assuming you'd be mailing > the > newsletters out directly after creating them [rather than storing them in a

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Chris
Arthur Erdös wrote: It can if you're trying to process a borked image... I've had imagecreatefromjpeg() eat memory up to almost 50x the size of the image before finally deciding it can't handle it and crapping out. That was *after* running it through getimagesize() with no problem at all. oka

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Chris
ok, the complete workflow is a little bit complicated. we are using a workflow engine and the newsletter generator is one step of three. the first cleans the statistics data, the second generates the new data and the third is the one which generates the mails. Put this in between each line and

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
It can if you're trying to process a borked image... I've had imagecreatefromjpeg() eat memory up to almost 50x the size of the image before finally deciding it can't handle it and crapping out. That was *after* running it through getimagesize() with no problem at all. okay - good point - but i

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
> Just post your source already. > ok, the complete workflow is a little bit complicated. we are using a workflow engine and the newsletter generator is one step of three. the first cleans the statistics data, the second generates the new data and the third is the one which generates the mails.

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Chris
Arthur Erdös wrote: Hello all, is there a way to free memory allocated by variables in PHP?? This is a very important issue concerning long running scripts... I have a script that generates > 5000 Newsletters and when the script finishes it uses 1.8 GB (!!) of RAM. Although I am using unset(

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Richard Lynch
On Thu, April 12, 2007 11:34 am, Arthur Erdös wrote: > no email goes out, the mails are stored in the database. http://mysql_free_result/ There may be something similar for the INSERT statements, or maybe there's nothing there to free up... But I suspect that you are keeping a *TON* of MySQL dat

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Richard Lynch
[combining responses] On Thu, April 12, 2007 8:13 am, Arthur Erdös wrote: > any ideas what i am doing wrong and where i [ab]use php? ^^ Not showing us source code is your biggest mistake... :-) On Thu, April 12, 2007 9:34 am, Zoltán Németh wrote: >> site/company I think we are okay on that front

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Richard Lynch
On Thu, April 12, 2007 6:40 am, Arthur Erdös wrote: > is there a way to free memory allocated by variables in PHP?? This is > a > very important issue concerning long running scripts... > > I have a script that generates > 5000 Newsletters and when the script > finishes it uses 1.8 GB (!!) of RAM.

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Edward Vermillion
On Apr 12, 2007, at 3:04 PM, Jochem Maas wrote: Edward Vermillion wrote: On Apr 12, 2007, at 11:17 AM, Jochem Maas wrote: Arthur Erdös wrote: int memory_get_usage ( [bool $real_usage] ) Returns the amount of memory, in bytes, that's currently being allocated to your PHP script. [snip]

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Jochem Maas
Arthur Erdös wrote: >> don't OMFG me - I can't read your cmdline from here you know, >> and I'm not the one with a completely borked script/system/whatever. >> > > a big sorry again for the missunderstanding!! ;) I did not omfg YOU! I > did omfg ME when I saw that the script eats much more memory

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Jochem Maas
Edward Vermillion wrote: > > On Apr 12, 2007, at 11:17 AM, Jochem Maas wrote: > >> Arthur Erdös wrote: int memory_get_usage ( [bool $real_usage] ) Returns the amount of memory, in bytes, that's currently being allocated to your PHP script. it returns the number of *b

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Stut
Arthur Erdös wrote: Arthur Erdös wrote: ok, its not really fast, but it runs on my development machine (AMD64, 4 GB of RAM, Ubuntu). mysql on the same machine, database with 175 tables and 2,3 GB data. that could probably slow down scripts, don't you agree? no. you have 4 F'ing gigs of ram on y

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Edward Vermillion
On Apr 12, 2007, at 11:17 AM, Jochem Maas wrote: Arthur Erdös wrote: int memory_get_usage ( [bool $real_usage] ) Returns the amount of memory, in bytes, that's currently being allocated to your PHP script. it returns the number of *bytes* !!! sure, and memory_get_usage()/1048576 returns

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
> Arthur Erdös wrote: > > ok, its not really fast, but it runs on my development machine (AMD64, 4 > > GB of RAM, Ubuntu). mysql on the same machine, database with 175 tables > > and 2,3 GB data. that could probably slow down scripts, don't you agree? > > no. you have 4 F'ing gigs of ram on your

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
> don't OMFG me - I can't read your cmdline from here you know, > and I'm not the one with a completely borked script/system/whatever. > a big sorry again for the missunderstanding!! ;) I did not omfg YOU! I did omfg ME when I saw that the script eats much more memory as memory_get_usage() return

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Jochem Maas
Arthur Erdös wrote: > ok, its not really fast, but it runs on my development machine (AMD64, 4 > GB of RAM, Ubuntu). mysql on the same machine, database with 175 tables > and 2,3 GB data. that could probably slow down scripts, don't you agree? no. you have 4 F'ing gigs of ram on your desktop and i

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Jochem Maas
Arthur Erdös wrote: >> int memory_get_usage ( [bool $real_usage] ) >> >> Returns the amount of memory, in bytes, that's currently being allocated to >> your PHP script. >> >> it returns the number of *bytes* !!! > > sure, and memory_get_usage()/1048576 returns the number of megs, or am i > wrong?

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
ok, its not really fast, but it runs on my development machine (AMD64, 4 GB of RAM, Ubuntu). mysql on the same machine, database with 175 tables and 2,3 GB data. that could probably slow down scripts, don't you agree? > On Thu, 2007-04-12 at 17:59 +0200, Arthur Erdös wrote: > > > > > > are you ex

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Robert Cummings
On Thu, 2007-04-12 at 17:59 +0200, Arthur Erdös wrote: > > > > are you experiencing severe load on the server whilst the script is running? > > and/or is the script actually very, very slow? > > well, the script is not very, very slow... it takes ~3-4 seconds to > generate each newsletter (includi

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
> int memory_get_usage ( [bool $real_usage] ) > > Returns the amount of memory, in bytes, that's currently being allocated to > your PHP script. > > it returns the number of *bytes* !!! sure, and memory_get_usage()/1048576 returns the number of megs, or am i wrong? o_O > > > > >> exactly how

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Jochem Maas
Arthur Erdös wrote: > 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 use

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
hihi, sorry for that! The Ads come from our Ad-Seller (or how is this called in english) and we have nearly no influence on what kind of ads are delivered ;) Am Donnerstag, den 12.04.2007, 16:18 +0200 schrieb Jochem Maas: > [EMAIL PROTECTED] wrote: > > Couple of questions come to mind... > > >

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
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 tem

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Zoltán Németh
2007. 04. 12, csütörtök keltezéssel 16.18-kor Jochem Maas ezt írta: > [EMAIL PROTECTED] wrote: > > Couple of questions come to mind... > > > > ... > > > 4. Please tell us these 'newsletters' don't contain information on "male > > enhancement products" or "govt seized puppies"..hah > > this spr

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Jochem Maas
[EMAIL PROTECTED] wrote: > Couple of questions come to mind... > ... > 4. Please tell us these 'newsletters' don't contain information on "male > enhancement products" or "govt seized puppies"..hah this spring to my mind as well - but given his domainname (brainguide), which points to a seemi

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Satyam
tes was all the memory anyone would ever need. Satyam - Original Message - From: "Arthur Erdös" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "Jochem Maas" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, April 12, 2007 3:13 PM Subje

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread tg-php
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? 2. Replacing the placeholders with act

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Jochem Maas
Zoltán Németh wrote: > 2007. 04. 12, csütörtök keltezéssel 15.52-kor Jochem Maas ezt írta: >> Arthur Erdös wrote: >>> I am using PHP version 5.1.2. on my dev machine. The same problem with >>> PHP 5.2.1 on webserver. >>> >>> I am generating mails based on a HTML Template. After reading the >>> tem

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Zoltán Németh
2007. 04. 12, csütörtök keltezéssel 15.52-kor Jochem Maas ezt írta: > Arthur Erdös wrote: > > I am using PHP version 5.1.2. on my dev machine. The same problem with > > PHP 5.2.1 on webserver. > > > > I am generating mails based on a HTML Template. After reading the > > template with fread() memo

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Jochem Maas
Arthur Erdös wrote: > I am using PHP version 5.1.2. on my dev machine. The same problem with > PHP 5.2.1 on webserver. > > I am generating mails based on a HTML Template. After reading the > template with fread() memory_get_usage() says ~386 MB in use... WTF - 386 megs for an html file??? someho

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
I am using PHP version 5.1.2. on my dev machine. The same problem with PHP 5.2.1 on webserver. I am generating mails based on a HTML Template. After reading the template with fread() memory_get_usage() says ~386 MB in use... Then the placeholders in the read template are replaced by customized

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
I am using PHP version 5.1.2. on my dev machine. The same problem with PHP 5.2.1 on webserver. I am generating mails based on a HTML Template. After reading the template with fread() memory_get_usage() says ~386 MB in use... Then the placeholders in the read template are replaced by customized

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
I am using PHP version 5.1.2. on my dev machine. The same problem with PHP 5.2.1 on webserver. I am generating mails based on a HTML Template. If you look at the appended screenshot you'll see that after reading the template with fread() memory_get_usage() says ~386 MB in use... Then the pla

Re: [PHP] free allocated memory: HOW ?

2007-04-12 Thread Jochem Maas
Arthur Erdös wrote: > Hello all, > > is there a way to free memory allocated by variables in PHP?? This is a > very important issue concerning long running scripts... this is a recurrent problem - not much can be done about it AFAIK ... I'd be very glad to be proved wrong. > > I have a script t

[PHP] free allocated memory: HOW ?

2007-04-12 Thread Arthur Erdös
Hello all, is there a way to free memory allocated by variables in PHP?? This is a very important issue concerning long running scripts... I have a script that generates > 5000 Newsletters and when the script finishes it uses 1.8 GB (!!) of RAM. Although I am using unset() to clean up variab