Re: [PHP-DEV] Don't add simple objects to GC's roots

2017-09-09 Thread Haitao Lv
> On 30 Jul 2017, at 18:19, Andreas Treichel wrote: > > Hi, > >> So I propose to make the gc_disable function accept one zval reference as >> parameter. And if gc_disable get that zval, gc_disable just drop the zval’s >> GC_COLLECTABLE flag, which will hint the PHP gc not to

Re: [PHP-DEV] Don't add simple objects to GC's roots

2017-07-30 Thread Andreas Treichel
Hi, So I propose to make the gc_disable function accept one zval reference as parameter. And if gc_disable get that zval, gc_disable just drop the zval’s GC_COLLECTABLE flag, which will hint the PHP gc not to trace that zval. i dont know if this is a good idea or not. But for the "s" in

Re: [PHP-DEV] Don't add simple objects to GC's roots

2017-07-29 Thread Haitao Lv
Hi, internals, > On 26 Jul 2017, at 22:57, Nicolas Grekas wrote: > > I'm hitting more and more the GC threshold in projects I work on (the "10k > roots" one), leading to high CPU usage. Usually, the GC finds nothing to > clean, so this is just a waste of CPU. More and

Re: [PHP-DEV] Don't add simple objects to GC's roots

2017-07-27 Thread ??????????
On 26 Jul 2017, at 22:57, ?? <0...@lvht.net> wrote:>> There is a way to work around: just call gc_disable(). But this means >> dealing with side effects of the engine in userland. Moreover, this also >> means leaking memory, since meanwhile roots are not populated. >Maybe we could make

Re: [PHP-DEV] Don't add simple objects to GC's roots

2017-07-27 Thread 吕海涛
Hi, > On 26 Jul 2017, at 22:57, Nicolas Grekas wrote: > > There is a way to work around: just call gc_disable(). But this means > dealing with side effects of the engine in userland. Moreover, this also > means leaking memory, since meanwhile roots are not populated.