php-general Digest 29 Sep 2009 09:08:52 -0000 Issue 6363

Topics (messages 298382 through 298399):

Re: Text similarity
        298382 by: Ashley Sheridan
        298384 by: Merlin Morgenstern
        298385 by: Ashley Sheridan
        298386 by: Tom Worster

Re: Bad impact of memory_limit set to -1 ?
        298383 by: Manuel Vacelet

DateTime/DateInterval/DatePeriod Class PHP source for older than PHP 5.3.0
        298387 by: jeff brown

Re: intl extension on os x
        298388 by: Tom Worster

WYSIWYG editor to change textarea
        298389 by: Angelo Zanetti
        298390 by: Ashley Sheridan
        298393 by: Ralph Deffke
        298398 by: HallMarc Websites
        298399 by: Manuel Lemos

Where's my memory going?!
        298391 by: Philip Thompson
        298392 by: Jim Lucas
        298394 by: Ralph Deffke
        298395 by: Philip Thompson
        298396 by: Philip Thompson
        298397 by: jeff brown

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Mon, 2009-09-28 at 12:27 +0200, Merlin Morgenstern wrote:
> Hi there,
> 
> I am trying to find out similarity between 2 strings. Somehow the 
> similar_text function returns 33% similarity on strings that are not 
> even close and on the other hand it returns 21% on strings that have a 
> matching word.
> 
> E.G:
> 
> 'gemütliche sofas'
> 
> Wohngemeinschaften - similarity: 33.333333333333
> Sofas & Sessel - similarity: 31.25
> 
> I am using this code:
> similar_text($data[txt], $categories[$i], $similarity);
> 
> Does anybody have an idea why it gives back 33% similarity on the first 
> string?
> 
> Thank you for any help,
> 
> Merlin
> 

If you think about it, it makes sense.

Taking your three sentences above, 'Wohngemeinschaften' has more
characters similar towards the start of the string (you only have to go
4 characters in to start a match) whereas 'sofas' won't match the source
string until the 12th string in. Also, both test strings have the same
number of characters that match in order, although the ones that match
in 'Wohngemeinschaften' are separated by characters that do not match,
so I'm not sure what bearing this will have.

As noted on the manual page for this function, the similar_text()
function compares without regard to string length, and tends to only
really be accurate enough for larger excerpts of text.

Thanks,
Ash
http://www.ashleysheridan.co.uk




--- End Message ---
--- Begin Message ---


Ashley Sheridan wrote:
On Mon, 2009-09-28 at 12:27 +0200, Merlin Morgenstern wrote:
Hi there,

I am trying to find out similarity between 2 strings. Somehow the similar_text function returns 33% similarity on strings that are not even close and on the other hand it returns 21% on strings that have a matching word.

E.G:

'gemütliche sofas'

Wohngemeinschaften - similarity: 33.333333333333
Sofas & Sessel - similarity: 31.25

I am using this code:
similar_text($data[txt], $categories[$i], $similarity);

Does anybody have an idea why it gives back 33% similarity on the first string?

Thank you for any help,

Merlin


If you think about it, it makes sense.

Taking your three sentences above, 'Wohngemeinschaften' has more
characters similar towards the start of the string (you only have to go
4 characters in to start a match) whereas 'sofas' won't match the source
string until the 12th string in. Also, both test strings have the same
number of characters that match in order, although the ones that match
in 'Wohngemeinschaften' are separated by characters that do not match,
so I'm not sure what bearing this will have.

As noted on the manual page for this function, the similar_text()
function compares without regard to string length, and tends to only
really be accurate enough for larger excerpts of text.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Sounds logical. Is there another function you suggest? I guess this is a standard problem I am having here. I tried it with levenstein, but similar results.

e.g levenstein (smaller = better):
Search for : Stellplatz für Wohnwagen gesucht
Stereoanlagen : 23
Wohnwagen, -mobile : 24
Sonstiges für Baby & Kind - : 25
Steuer & Finanzen - :25

How come stereoanlagen and the others shows up here?

Any idea how I could make this more accurate?

Thank you for any help, Merlin

--- End Message ---
--- Begin Message ---
On Mon, 2009-09-28 at 13:07 +0200, Merlin Morgenstern wrote:
> 
> Ashley Sheridan wrote:
> > On Mon, 2009-09-28 at 12:27 +0200, Merlin Morgenstern wrote:
> >> Hi there,
> >>
> >> I am trying to find out similarity between 2 strings. Somehow the 
> >> similar_text function returns 33% similarity on strings that are not 
> >> even close and on the other hand it returns 21% on strings that have a 
> >> matching word.
> >>
> >> E.G:
> >>
> >> 'gemütliche sofas'
> >>
> >> Wohngemeinschaften - similarity: 33.333333333333
> >> Sofas & Sessel - similarity: 31.25
> >>
> >> I am using this code:
> >> similar_text($data[txt], $categories[$i], $similarity);
> >>
> >> Does anybody have an idea why it gives back 33% similarity on the first 
> >> string?
> >>
> >> Thank you for any help,
> >>
> >> Merlin
> >>
> > 
> > If you think about it, it makes sense.
> > 
> > Taking your three sentences above, 'Wohngemeinschaften' has more
> > characters similar towards the start of the string (you only have to go
> > 4 characters in to start a match) whereas 'sofas' won't match the source
> > string until the 12th string in. Also, both test strings have the same
> > number of characters that match in order, although the ones that match
> > in 'Wohngemeinschaften' are separated by characters that do not match,
> > so I'm not sure what bearing this will have.
> > 
> > As noted on the manual page for this function, the similar_text()
> > function compares without regard to string length, and tends to only
> > really be accurate enough for larger excerpts of text.
> > 
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> > 
> > 
> > 
> 
> Sounds logical. Is there another function you suggest? I guess this is a 
> standard problem I am having here. I tried it with levenstein, but 
> similar results.
> 
> e.g levenstein (smaller = better):
> Search for : Stellplatz für Wohnwagen gesucht
> Stereoanlagen : 23
> Wohnwagen, -mobile : 24
> Sonstiges für Baby & Kind - : 25
> Steuer & Finanzen - :25
> 
> How come stereoanlagen and the others shows up here?
> 
> Any idea how I could make this more accurate?
> 
> Thank you for any help, Merlin
> 

I'm guessing it's to do with the position of characters within the
string. You could roll your own function, that does what you
specifically need.

Break down the lines into individual words.

Loop through the match string and see if the words exist within the
phrases you're searching in, and keep a count of all 'hits'. As you
loop, create a metaphone key (soundex might also help, but I think
metaphone will work fairly well for German) and check this against a
metaphone version of the phrases you're searching in. Keep a separate
count of metaphone matches.

At the end, any of the search phrases that have either type of count is
a match. Collate them, and order by solid matches (whole words) and then
by metaphone matches.

This is very simplified, and will need a lot of tweaking to get it
right, but it might be somewhere to start?

Thanks,
Ash
http://www.ashleysheridan.co.uk




--- End Message ---
--- Begin Message ---
On 9/28/09 7:07 AM, "Merlin Morgenstern" <merli...@fastmail.fm> wrote:

> 
> 
> Ashley Sheridan wrote:
>> On Mon, 2009-09-28 at 12:27 +0200, Merlin Morgenstern wrote:
>>> Hi there,
>>> 
>>> I am trying to find out similarity between 2 strings. Somehow the
>>> similar_text function returns 33% similarity on strings that are not
>>> even close and on the other hand it returns 21% on strings that have a
>>> matching word.
>>> 
>>> E.G:
>>> 
>>> 'gemütliche sofas'
>>> 
>>> Wohngemeinschaften - similarity: 33.333333333333
>>> Sofas & Sessel - similarity: 31.25
>>> 
>>> I am using this code:
>>> similar_text($data[txt], $categories[$i], $similarity);
>>> 
>>> Does anybody have an idea why it gives back 33% similarity on the first
>>> string?
>>> 
>>> Thank you for any help,
>>> 
>>> Merlin
>>> 
>> 
>> If you think about it, it makes sense.
>> 
>> Taking your three sentences above, 'Wohngemeinschaften' has more
>> characters similar towards the start of the string (you only have to go
>> 4 characters in to start a match) whereas 'sofas' won't match the source
>> string until the 12th string in. Also, both test strings have the same
>> number of characters that match in order, although the ones that match
>> in 'Wohngemeinschaften' are separated by characters that do not match,
>> so I'm not sure what bearing this will have.
>> 
>> As noted on the manual page for this function, the similar_text()
>> function compares without regard to string length, and tends to only
>> really be accurate enough for larger excerpts of text.
>> 
>> Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
>> 
>> 
>> 
> 
> Sounds logical. Is there another function you suggest? I guess this is a
> standard problem I am having here. I tried it with levenstein, but
> similar results.
> 
> e.g levenstein (smaller = better):
> Search for : Stellplatz fÃ1Ž4r Wohnwagen gesucht
> Stereoanlagen : 23
> Wohnwagen, -mobile : 24
> Sonstiges fÃ1Ž4r Baby & Kind - : 25
> Steuer & Finanzen - :25
> 
> How come stereoanlagen and the others shows up here?
> 
> Any idea how I could make this more accurate?
> 
> Thank you for any help, Merlin

as ashley pointed out, it's not a trivial problem.

if you are performing the tests against strings in a db table then a full
text index might help. see, e.g.:
http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

you could also check out the php sphinx client
http://us3.php.net/manual/en/book.sphinx.php

if you are writing your own solutions and using utf8, take care with
similar_text() or levenshtein(). i don't think they are designed for
multibyte strings. so if you are using utf8 they will probably report bigger
differences that you might expect. i wrote my own limited
damerau-levenshtein function for utf8.

even if you're using a single byte encoding, i would guess they ignore a
locale's collation. so say you set a german locale, ü will be regarded as
different from both u and ue. again, if you are searching against against
strings in a db table, the dbms may understand collations properly.



--- End Message ---
--- Begin Message ---
On Fri, Sep 25, 2009 at 2:18 PM, Manuel Vacelet
<manuel.vace...@gmail.com> wrote:
> Hi all,
>
> I fighting with SoapServer to be able to upload large file base64 encoded.
> Every so often I get memory exhausted error messages and
> memory_get_usage() tells me that my script starts with more than 250MB
> allocated (for a soap request of 85MB!).
>
> I'm wondering if I would let memory_limit unbound (-1) to avoid those
> issues but I don't know what would be the consequences (esp. on
> apaches processes, total allocated memory, etc).
>
> Any advice ?
> Thanks,
> Manuel

Hi,

I've read somewhere that increasing memory_limit can affect server's
ability to handle concurrency.
Is it urban legends or is it correct ?
And if it's correct, what about setting it to -1 ?

Manuel

--- End Message ---
--- Begin Message --- So I'm jealous, the functionality in the DateTime class, DateInterval class and DatePeriod class are exactly what I need in my current application, but my Host is on PHP 5.2.10, which has a partial DateTime class, but not the others. I'd like to add a:

--------------------------------------

if (!class_exists('DateTime')) {

/* definition of DateTime */

}
if (!class_exists('DateInterval')) {

/* definition of DateInterval */

}
if (!class_exists('DatePeriod')) {

/* definition of DatePeriod */

}

----------------------------------

That way when my Hosting company gets its act together I won't break any code.

Are there any resources for me? I'm willing to dig, and even downloaded the source to 5.3.0, only to find that the php class seems to be "faked" in the C code for /ext/date/date.[ch]

Which doesn't help me unless I compile it on my own. I'm looking for a lighter weight solution, just the php code that's equivalent to the classes ... doesn't it exist somewhere? A basis that Derick Rethans used to make it?

Jeff

--- End Message ---
--- Begin Message ---
On 9/28/09 2:41 AM, "Tommy Pham" <tommy...@yahoo.com> wrote:

> ----- Original Message ----
>> From: Tom Worster <f...@thefsb.org>
>> To: PHP General List <php-gene...@lists.php.net>
>> Sent: Sunday, September 27, 2009 5:34:45 PM
>> Subject: [PHP] intl extension on os x
>> 
>> does anyone know how to install intl on os x 10.5?
>> 
>> it seems a libicu binary is included in os x but not with headers. fink has
>> a package for installing the headers. maybe that would allow pecl to install
>> the intl extension.
>> 
>> has anyone done this successfully? or know any other way to get intl running
>> on 10.5?
>> 
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> When Apple made the big change of OS a few years back, they switch to *BSD
> based OS, with the GUI from NeXT, which Apple bought. You should be able to
> compile most linux/unix codes on Mac though.  Have you looked at Apple's
> developer's resources/documentation?

yes indeed. often you can successfully compile and install on os x things
that run on freebsd or linux. but port configuration is often substantially
different and not entirely handled by autoconf. (even compiling php requires
some tricks.) in these cases i refer to google because people smarter than
me (one assumes, everything you read on the internet being true, of course)
often blog their recipe if the find one. but i found nothing for this
problem. that's why i asked here.

at this stage, i installed the fink package libicu36-dev-3.6.0-5, supposedly
libicu headers and it seems to have done something, i'm not entirely sure
exactly what. and i'm not convinced that the headers are for the same libicu
version that's in /usr/lib.

but somehow, though i'm not clear how one configures pecl source, i managed
to get pecl to compile and install the extension.

anyway, in the cli the command collator_create( 'en_US' ); did not provoke
an error, so maybe that works.

but if i add extension=intl.so to php.ini and restart apache, php says: PHP
Warning:  PHP Startup: Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20060613/intl.so'

so we're not done yet. if i get it done, maybe i'll blog my recipe.

freebsd, otoh, has a port for pecl-intl so it was trivial to install. 



--- End Message ---
--- Begin Message ---
Hi all, 

I have been looking to implement a WYSIWYG editor that will automatically
transform a <textarea> into a Rich text area / WYSIWYG. We have lots of
dynamic content that is pulled from a database and files. Therefore we cant
really change the <textarea> field.

I have tried the tinyMCE but its causing conflicts with some existing JS
code that cant really be rewritten.

A lot of other editors actually generate the rich text area in a strange way
and don't use the <textarea> field at all.

Are there any editors that you people will know of that operate in a similar
way to tinyMCE, IE you include the JS in your head and it will change all
the textarea fields to rich text areas?

Thanks in advance.

http://www.elemental.co.za 
http://www.wapit.co.za




--- End Message ---
--- Begin Message ---
On Mon, 2009-09-28 at 22:30 +0200, Angelo Zanetti wrote:
> Hi all, 
> 
> I have been looking to implement a WYSIWYG editor that will automatically
> transform a <textarea> into a Rich text area / WYSIWYG. We have lots of
> dynamic content that is pulled from a database and files. Therefore we cant
> really change the <textarea> field.
> 
> I have tried the tinyMCE but its causing conflicts with some existing JS
> code that cant really be rewritten.
> 
> A lot of other editors actually generate the rich text area in a strange way
> and don't use the <textarea> field at all.
> 
> Are there any editors that you people will know of that operate in a similar
> way to tinyMCE, IE you include the JS in your head and it will change all
> the textarea fields to rich text areas?
> 
> Thanks in advance.
> 
> http://www.elemental.co.za 
> http://www.wapit.co.za
> 
> 
> 
> 
The one that I tend to use these days is FCKEditor. Poorly named I know,
but apparently those were the guys initials (he had mean parents who
weren't aware of the connotations in the English language)

I heard today as well that there is a new version of this out called
CKEditor (apparently he spoke to someone who knows about the English
connotations) although I've not yet looked into this myself.

Thanks,
Ash
http://www.ashleysheridan.co.uk




--- End Message ---
--- Begin Message ---
I can recomment the YAHOO editor for that. seemed to me they are very
conflictless with other js code

http://developer.yahoo.com/yui/editor/

good luck
ralph_def...@yahoo.de


""Angelo Zanetti"" <ang...@elemental.co.za> wrote in message
news:20090928203015.0512b99...@smtp1.vodamail.co.za...
> Hi all,
>
> I have been looking to implement a WYSIWYG editor that will automatically
> transform a <textarea> into a Rich text area / WYSIWYG. We have lots of
> dynamic content that is pulled from a database and files. Therefore we
cant
> really change the <textarea> field.
>
> I have tried the tinyMCE but its causing conflicts with some existing JS
> code that cant really be rewritten.
>
> A lot of other editors actually generate the rich text area in a strange
way
> and don't use the <textarea> field at all.
>
> Are there any editors that you people will know of that operate in a
similar
> way to tinyMCE, IE you include the JS in your head and it will change all
> the textarea fields to rich text areas?
>
> Thanks in advance.
>
> http://www.elemental.co.za
> http://www.wapit.co.za
>
>
>



--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Ralph Deffke [mailto:ralph_def...@yahoo.de]
> Sent: Monday, September 28, 2009 5:18 PM
> To: php-gene...@lists.php.net
> Subject: [PHP] Re: WYSIWYG editor to change textarea
> 
> I can recomment the YAHOO editor for that. seemed to me they are very
> conflictless with other js code
> 
> http://developer.yahoo.com/yui/editor/
> 
> good luck
> ralph_def...@yahoo.de
> 
> 
> ""Angelo Zanetti"" <ang...@elemental.co.za> wrote in message
> news:20090928203015.0512b99...@smtp1.vodamail.co.za...
> > Hi all,
> >
> > I have been looking to implement a WYSIWYG editor that will
> automatically
> > transform a <textarea> into a Rich text area / WYSIWYG. We have lots
> of
> > dynamic content that is pulled from a database and files. Therefore
> we
> cant
> > really change the <textarea> field.
> >
> > I have tried the tinyMCE but its causing conflicts with some existing
> JS
> > code that cant really be rewritten.
> >
> > A lot of other editors actually generate the rich text area in a
> strange
> way
> > and don't use the <textarea> field at all.
> >
> > Are there any editors that you people will know of that operate in a
> similar
> > way to tinyMCE, IE you include the JS in your head and it will change
> all
> > the textarea fields to rich text areas?
> >
> > Thanks in advance.
> >
> > http://www.elemental.co.za
> > http://www.wapit.co.za
> >

I will look at this Yahoo! thanks too. I wanted to throw my 2 cents in here:
TinyMCE was the one I usually recommended yet your experience has been one
of my biggest gripes about it. I would lean to believe that they were
attempting to "Dummy Proof" it and in doing so made it frustrating to use
unless, you learn how to use it the it was meant to be used and not how you
expect it. 


Thank you,
Marc Hall
HallMarc Websites
610.446.3346
 

__________ Information from ESET Smart Security, version of virus signature
database 4465 (20090928) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 


--- End Message ---
--- Begin Message ---
Viva,

on 09/28/2009 05:30 PM Angelo Zanetti said the following:
> Hi all, 
> 
> I have been looking to implement a WYSIWYG editor that will automatically
> transform a <textarea> into a Rich text area / WYSIWYG. We have lots of
> dynamic content that is pulled from a database and files. Therefore we cant
> really change the <textarea> field.
> 
> I have tried the tinyMCE but its causing conflicts with some existing JS
> code that cant really be rewritten.
> 
> A lot of other editors actually generate the rich text area in a strange way
> and don't use the <textarea> field at all.
> 
> Are there any editors that you people will know of that operate in a similar
> way to tinyMCE, IE you include the JS in your head and it will change all
> the textarea fields to rich text areas?

Coincidentaly I have just written about a new HTML editor precisely with
that focus. You may want to take a look at this article.

The editor was meant to be integrated as a plug-in of tha forms
generation and validation class, but it may was as standalone. That is
explained in the article.

http://www.phpclasses.org/blog/package/1/post/3-Upcoming-Visual-HTML-templates-editor-plugin.html



-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
Hi all.

I have a script that opens a socket, creates a persistent mysql connection, and loops to receive data. When the amount of specified data has been received, it calls a class which processes the data and inserts it into the database. Each iteration, I unset/destruct that class I call. However, the script keeps going up in memory and eventually runs out, causing a fatal error. Any thoughts on where to start to see where I'm losing my memory?

Thanks in advance,
~Philip

--- End Message ---
--- Begin Message ---
Philip Thompson wrote:
> Hi all.
> 
> I have a script that opens a socket, creates a persistent mysql
> connection, and loops to receive data. When the amount of specified data
> has been received, it calls a class which processes the data and inserts
> it into the database. Each iteration, I unset/destruct that class I
> call. However, the script keeps going up in memory and eventually runs
> out, causing a fatal error. Any thoughts on where to start to see where
> I'm losing my memory?
> 
> Thanks in advance,
> ~Philip
> 

We cannot tell you anything without see an example of what your script is doing.

Let us see some code!

--- End Message ---
--- Begin Message ---
well this sound clearly to me like you are not freeing resultsets you are not 
going to use anymore. In long scripts you have to take care of this. on short 
scripts you can be a bit weak on that, because the resultsets are closed and 
freed on script ending.

assumed u r using MySQL are u using mysql_free_result($result)

goog luck

ralph_def...@yahoo.de


"Philip Thompson" <philthath...@gmail.com> wrote in message 
news:9c0b9c4c-5e64-4519-862b-8a3e1da4d...@gmail.com...
> Hi all.
> 
> I have a script that opens a socket, creates a persistent mysql  
> connection, and loops to receive data. When the amount of specified  
> data has been received, it calls a class which processes the data and  
> inserts it into the database. Each iteration, I unset/destruct that  
> class I call. However, the script keeps going up in memory and  
> eventually runs out, causing a fatal error. Any thoughts on where to  
> start to see where I'm losing my memory?
> 
> Thanks in advance,
> ~Philip

--- End Message ---
--- Begin Message ---
On Sep 28, 2009, at 4:18 PM, Jim Lucas wrote:

Philip Thompson wrote:
Hi all.

I have a script that opens a socket, creates a persistent mysql
connection, and loops to receive data. When the amount of specified data has been received, it calls a class which processes the data and inserts
it into the database. Each iteration, I unset/destruct that class I
call. However, the script keeps going up in memory and eventually runs out, causing a fatal error. Any thoughts on where to start to see where
I'm losing my memory?

Thanks in advance,
~Philip


We cannot tell you anything without see an example of what your script is doing.

Let us see some code!

I was wondering if you were gonna ask that! Umm... I don't know if I can show you the code b/c it's not as trivial as I explained it above. I'll tell you what, I give you something to chew on and you let me know if it's enough.

<?php
class SocketListener extends Socket
{
    public function __construct ()
    {
        $this->core = new coreFunctions (false, 'interface');
        parent::__construct ($this->core, $host, $port, $clients);
        $this->readFunction = 'processData';
        $this->startPersistentListener();
    }

    public function processData ($data)
    {
        if ($this->filetype == 'demographics') {
            $demoImporter = new Demographics ();
            $ret = $demoImporter->importFromDataStream ($data);
            $demoImporter->__destruct();
            unset ($demoImporter);
echo "Memory usage: " . number_format (memory_get_usage ()) . "\n";
            return $ret;
        }
    }
}

class Socket
{
    public function startPersistentListener ()
    {
        // Create a persistent listening socket connection
        $this->create();
        $this->setOption(SOL_SOCKET, SO_KEEPALIVE, 1);
        $this->bind();
        $this->listen();
        $this->clients = array($this->sock);

        while ($this->isAlive) {
            // Create the list of connected clients
            $this->createClients();

            if ($this->select() < 1) {
                // No clients - go to the next iteration
                continue;
            }

            $this->accept();
            $this->read();
        }
    }
}

set_time_limit (0);
new SocketListener ();
?>

I stripped out a lot of code, but this is the basics. I have a listener class that extends the socket class. When the socket class receives some data, it calls the processData() method - which creates a new instance of the Demographics class. It destroys the instance after it's finished. The line where I echo the memory usage indicates that the memory continues to grow until it just explodes.

There's a lot more going on behind the scenes that *could* cause the memory leak, but hopefully this will give you somewhere to go.

Thanks!
~Philip

--- End Message ---
--- Begin Message ---
On Sep 28, 2009, at 4:27 PM, Ralph Deffke wrote:

well this sound clearly to me like you are not freeing resultsets you are not going to use anymore. In long scripts you have to take care of this. on short scripts you can be a bit weak on that, because the resultsets are closed and freed on script ending.

assumed u r using MySQL are u using mysql_free_result($result)

goog luck

ralph_def...@yahoo.de


"Philip Thompson" <philthath...@gmail.com> wrote in message news:9c0b9c4c-5e64-4519-862b-8a3e1da4d...@gmail.com ...
Hi all.

I have a script that opens a socket, creates a persistent mysql
connection, and loops to receive data. When the amount of specified
data has been received, it calls a class which processes the data and
inserts it into the database. Each iteration, I unset/destruct that
class I call. However, the script keeps going up in memory and
eventually runs out, causing a fatal error. Any thoughts on where to
start to see where I'm losing my memory?

Thanks in advance,
~Philip

I am not using mysql_free_result(). Is that highly recommended by all?

Thanks,
~Philip

--- End Message ---
--- Begin Message --- Yes, that's the best way to clean up after yourself. And you really should use that on anything you have sitting around daemon like.

Jeff

Philip Thompson wrote:
On Sep 28, 2009, at 4:27 PM, Ralph Deffke wrote:

well this sound clearly to me like you are not freeing resultsets you are not going to use anymore. In long scripts you have to take care of this. on short scripts you can be a bit weak on that, because the resultsets are closed and freed on script ending.

assumed u r using MySQL are u using mysql_free_result($result)

goog luck

ralph_def...@yahoo.de


"Philip Thompson" <philthath...@gmail.com> wrote in message news:9c0b9c4c-5e64-4519-862b-8a3e1da4d...@gmail.com...
Hi all.

I have a script that opens a socket, creates a persistent mysql
connection, and loops to receive data. When the amount of specified
data has been received, it calls a class which processes the data and
inserts it into the database. Each iteration, I unset/destruct that
class I call. However, the script keeps going up in memory and
eventually runs out, causing a fatal error. Any thoughts on where to
start to see where I'm losing my memory?

Thanks in advance,
~Philip

I am not using mysql_free_result(). Is that highly recommended by all?

Thanks,
~Philip

--- End Message ---

Reply via email to