8000 Comment GC disable and enable GC after run by Z1ni · Pull Request #3503 · composer/composer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Comment GC disable and enable GC after run #3503

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

Closed
wants to merge 1 commit into from
Closed

Conversation

Z1ni
Copy link
@Z1ni Z1ni commented Dec 3, 2014

Fixes #3488

@@ -336,6 +337,8 @@ public function run()
}
}

gc_enable();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this triggers a warning on HHVM for some configurations, so this should be handled

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which kind of warning ? is it something that can be handled by wrapping it in a "if not hhvm" ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it can

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i've quickly check and it can be done with

if (defined('HHVM_VERSION')) {
    // Code
}

(dunno if it helps)

@marc-mabe
Copy link
Contributor

gc_enabled should be used to only disable GC before run and re-enable after only if it was enabled before.

@@ -160,6 +160,7 @@ public function __construct(IOInterface $io, Config $config, RootPackageInterfac
*/
public function run()
{
// Disable garbage collection to save memory and time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not saving memory. It is about saving time because the GC will be triggered many times (because of the amount of Zval used in the solver for the package graph) for cases where it cannot collect anything (the refcount will take care of all the package graph objects btw)

@Seldaek Seldaek closed this in c2d78e5 Feb 29, 2016
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

Successfully merging this pull request may close these issues.

Consider re-enabling GC after solving
4 participants
0