On Fri, Aug 1, 2014 at 12:34 AM, Pascal Chevrel <pascal.chev...@free.fr> wrote: > Le 31/07/2014 16:23, Laruence a écrit : > >> Hey: >> >> On Thu, Jul 31, 2014 at 8:29 PM, Pascal Chevrel <pascal.chev...@free.fr> >> wrote: >>> >>> Le 26/07/2014 04:42, Laruence a écrit : >>> >>>> Hey: >>>> >>>> On Fri, Jul 25, 2014 at 9:14 PM, Pascal Chevrel <pascal.chev...@free.fr> >>>> wrote: >>>>> >>>>> >>>>> Hi, >>>>> >>>>> I tried the .deb package for phpng that Zend provides since yesterday >>>>> (thanks for that!) and I hit a memory consumption issue with the first >>>>> of >>>>> my >>>>> scripts I tried: >>>>> >>>>> PHPNG: >>>>> Memory peak: 62914560 (55.97MB) >>>>> Elapsed time (s): 0.3383 >>>>> >>>>> PHP 5.5: >>>>> Memory peak: 1835008 (1.64MB) >>>>> Elapsed time (s): 0.0717 >>>>> >>>>> How/where can I make a bug report about it? Is https://bugs.php.net/ ok >>>>> for >>>>> PHPNG bugs? >>>> >>>> >>>> PHPNG is not listed in bugs.php.net yet. but as it's a branch of PHP >>>> , I think it's okey to report it there, and note it's PHPNG in the >>>> comment. for now. >>>> >>>> thanks >>> >>> >>> >>> Hi, >>> >>> I opened this bug: >>> https://bugs.php.net/bug.php?id=67725 >>> >>> I put a testcase triggering the memory leak in a github repo referenced >>> in >>> the bug. >> >> I am afraid this is not a bug. >> >> it's due to our new immutable array implementation. >> >> all these langs map array are constant array, such it will be treat as >> immutable array, which means it will not be released untill the >> request shutdown. (which will bring significant performance >> improvement for saving array construct/destruct while use with >> opcache) >> >> I suggest you to increase the memory_limit as a workaround .. >> >> Anyway, Dmitry, what do you think? maybe something like >> interned_string_size? >> > > Hi, > > The problem is that the more arrays I load, the more memory PHPNG consumes > while current versions of PHP have that value mostly stable. I have with > PHPNG a scalability issue I don't have with regular PHP. If tomorrow I > increase the number of languages I support in my app from 70 to 200 (which > is my long term goal btw), I would probably need to set memory_limit to > 700MB which seems honestly crazy when PHP 5.x needs 8MB for the same script > to run at the same speed. As an end user, I think it's a bug not a feature, > I hope you understand my point of view :).
I understand your point, and the problem, but the thing here is, do you really needs loads all langs map arrays in a single request(as I understand you only need one per request, right?) > > Also, people on shared hosting can't change the memory_limit value, it > doesn't sound like a change that is good for PHP in shared hosting > environment which is a large part of PHP success. > > You mention that it is beneficial when OPCache is activated, but it isn't > activated by default, so the theoretical gain would only work for people > that can activate it, right? Or does it mean that OPCache would be activated > by default in PHP 7? I will suggest to enable it by default in NG. > > Is there no way to release the memory programmatically before the request > ends? Shouldn't explicitely using unset() on the array at the end of each > iteration indicate to the engine that I don't just want to destroy the array > reference but also get the memory back? That sounds like a very significant > change in how PHP behaves today with arrays, doesn't it? PHPNG is promoted > as a big speed optimization that wouldn't impact userland code, well, in my > case it does and very significantly if parts of my app crash or use 20 or 30 > times more memory than before for a 5% speed gain, it's not a win. If there > is a way to force PHP to unload that data from memory and basically behave > like PHP 5.x it could at least be in PHP 7 upgrade release notes for people > like me that build stuff on today's PHP strengths. hmm, I will definitely ask dmitry 's idea.. thanks > > Thanks, > > > Pascal > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Laruence Xinchen Hui http://www.laruence.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php