# [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/tests/bug55509.phpt branches/PHP_5_3/Zend/zend_alloc.c branches/PHP_5_4/Zend/tests/bug55509.phpt branches/PHP_5_4/Zend/zend_alloc.c trunk/Zend/tests/bug55509.phpt trunk/Zend

- Thread: https://externals.io/message/55590
- Original archive: https://news-web.php.net/php.internals/55590
- Started by Ferenc Kovacs on 2011-09-22T20:34:24+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #55590 — Ferenc Kovacs — 2011-09-22T20:34:24+00:00

URL: https://externals.io/message/55590#55590

I just stumbled upon on this test as it timed out for me(my test vm
started swapping, so run-tests.php terminated after 60 sec).
I think it would be good if we could somehow check the available ram,
and skipif if it isn't enough, and I think we could also save off an
str_repeat call:
each str_repeat call allocates 512M of ram, so the 5th call will never
happen when the bug is present, as it would allocate a little more
than 2.5G ram.
the test could be modified having a memory limit of 2100M and removing
the sixth str_repeat call and the line '5' from the expect output.

btw: what do you think about adding a memory_get_available() function:
http://stackoverflow.com/questions/2513505/how-to-get-available-memory-c-g/2513561#2513561

On Tue, Sep 13, 2011 at 8:17 PM, Christopher Jones
<christopher.jones@oracle.com> wrote:
>
> Dmitry,
>
> This is diffing for me in 5.4 (I've haven't looked at 5.3 or trunk):
>
> 007+ Fatal error: Allowed memory size of 3221225472 bytes exhausted at
> /home/cjones/phpsrc/php/php-src/branches/PHP_5_4/ext/standard/string.c:4636
> (tried to allocate 536870913 bytes) in
> /home/cjones/phpsrc/php/php-src/branches/PHP_5_4/Zend/tests/bug55509.php on
> line 12
> 007- Fatal error: Allowed memory size of %d bytes exhausted (tried to
> allocate %d bytes) in %s/bug55509.php on line %d
>
> Chris
>
> 
> > […]
>
> --
> Email: christopher.jones@oracle.com
> Tel:  +1 650 506 8630
> Blog:  http://blogs.oracle.com/opal/
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> 
>
>



-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu
