Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sfBrowser memory leak #2

Open
acleitner opened this issue Apr 14, 2015 · 6 comments
Open

sfBrowser memory leak #2

acleitner opened this issue Apr 14, 2015 · 6 comments

Comments

@acleitner
Copy link

The exact same issue as this ticket http://trac.symfony-project.org/ticket/6621
The ticket claims that PHP 5.3 fixes the issue, that is not the case.

@boutell
Copy link
Member

boutell commented Apr 14, 2015

Probably right, we would have to manually break the circular references.

However since sfBrowser is only used for functional tests and this is not a critical bug for anything user-facing, it would have to be a clean fix with no impact on the API.

@TheCelavi
Copy link

Link is dead with reported issue -> can you state the issue please, I would like to take a look...

@mkopinsky
Copy link

The link is back up, but I'll copy paste here for posterity's sake:

Original ticket:

The sfBrowser object has a very pervasive memory leak. See example code.

<?php

include(dirname(__FILE__).'/../../bootstrap/functional.php');

for ( $i = 0; $i <= 20; $i++ )
{
 $browser = new sfTestBrowser();
 $browser->initialize();
 $browser->
   get('/')->
   info('memory after test #'.$i.': ' . memory_get_peak_usage());

 $browser->shutdown();
 unset($browser);
 sfContext::getInstance()->shutdown();
}

The test will consume more and more memory after every request, despite running the destructors and unsetting the variable.

Closed by fabien as wontfix on 06/14/09 16:31:08:

That's a PHP problem with the garbage collection when objects have circular reference for which we can do nothing. That said, it has been fixed in PHP 5.3.

@boutell
Copy link
Member

boutell commented Jun 9, 2015

Was it really fixed in 5.3?

On Tue, Jun 9, 2015 at 2:43 PM, Michael Kopinsky [email protected]
wrote:

The link is back up, but I'll copy paste here for posterity's sake:

Original ticket:

The sfBrowser object has a very pervasive memory leak. See example code.

initialize(); $browser-> get('/')-> info('memory after test #'.$i.': ' . memory_get_peak_usage()); $browser->shutdown(); unset($browser); sfContext::getInstance()->shutdown(); } The test will consume more and more memory after every request, despite running the destructors and unsetting the variable. Closed by fabien as wontfix on 06/14/09 16:31:08: That's a PHP problem with the garbage collection when objects have circular reference for which we can do nothing. That said, it has been fixed in PHP 5.3. — Reply to this email directly or view it on GitHub https://github.com//issues/2#issuecomment-110460726.

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

@boutell
Copy link
Member

boutell commented Jun 9, 2015

I mean, yes, 5.3 gave PHP the ability to break circular references, but
does it address the problem you're having?

On Tue, Jun 9, 2015 at 2:58 PM, Tom Boutell [email protected] wrote:

Was it really fixed in 5.3?

On Tue, Jun 9, 2015 at 2:43 PM, Michael Kopinsky <[email protected]

wrote:

The link is back up, but I'll copy paste here for posterity's sake:

Original ticket:

The sfBrowser object has a very pervasive memory leak. See example code.

initialize(); $browser-> get('/')-> info('memory after test #'.$i.': ' . memory_get_peak_usage()); $browser->shutdown(); unset($browser); sfContext::getInstance()->shutdown(); } The test will consume more and more memory after every request, despite running the destructors and unsetting the variable. Closed by fabien as wontfix on 06/14/09 16:31:08: That's a PHP problem with the garbage collection when objects have circular reference for which we can do nothing. That said, it has been fixed in PHP 5.3. — Reply to this email directly or view it on GitHub https://github.com//issues/2#issuecomment-110460726.

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

@boutell
Copy link
Member

boutell commented Jun 9, 2015

OK, I see Aaron's comment that PHP 5.3 doesn't help.

Presumably each instance of sfBrowser adds itself to an array somewhere
that never dies (or creates something that references both it and some
other long-lived object, etc. etc.).

On Tue, Jun 9, 2015 at 2:43 PM, Michael Kopinsky [email protected]
wrote:

The link is back up, but I'll copy paste here for posterity's sake:

Original ticket:

The sfBrowser object has a very pervasive memory leak. See example code.

initialize(); $browser-> get('/')-> info('memory after test #'.$i.': ' . memory_get_peak_usage()); $browser->shutdown(); unset($browser); sfContext::getInstance()->shutdown(); } The test will consume more and more memory after every request, despite running the destructors and unsetting the variable. Closed by fabien as wontfix on 06/14/09 16:31:08: That's a PHP problem with the garbage collection when objects have circular reference for which we can do nothing. That said, it has been fixed in PHP 5.3. — Reply to this email directly or view it on GitHub https://github.com//issues/2#issuecomment-110460726.

*THOMAS BOUTELL, *DEV & OPS
P'UNK AVENUE | (215) 755-1330 | punkave.com

iangregory referenced this issue in iangregory/symfony1 Dec 22, 2020
Fix for exception handling in PHP 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants