public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: km2z7kca0oge@opayq.com
To: cygwin@cygwin.com
Subject: RE: Cygwin PHP (all available versions) has a hard 4MB memory limit
Date: Sat, 18 Jul 2020 15:33:59 +0000	[thread overview]
Message-ID: <1027954883.77500.1595086445002@smtp4.opayq.com> (raw)

> You told us nothing about what versions of Windows, Cygwin, and PHP you are running, so WAG, either:
Wow Brian, what a rude response. I definitely followed the problem reporting guide, and didn't realise you'd need information overload that probably doesn't relate to the case at hand. When reporting bugs I always give as much info as I believe is needed in helping, there's no need to snap.

I gave lots of information, such as:
  - It applies to all bundled versions of PHP from the `setup-x86-64.exe`.
  - That I've reproduced it on multiple (two) machines, including one of those being a machine that has never had (and so a fresh install of) Cygwin with just PHP added.
  - Compiling PHP from source doesn't produce this issue so it's something to do with the bundled version only

For extra information, both machines tested are:
  - Windows 10 64-bit (10.0.18363)
  - One machine is 16GB, the other 8GB RAM.
  - All PHP versions from the `setup-x86-64.exe` (7.3.4-1 and 7.1.16-1)

> - you have defaulted to or specified a PHP configuration limit of 4MB memory for PHP tasks, or
Nope, as shown in the output of my example, the memory limit is set to 128MB:
> Output:
> $ php test.php
> 128M <--- This here shows the configured memory limit
> PHP Fatal error:  Out of memory (allocated 4194304) (tried to allocate 2097184 bytes) in /c/Users/JackBlower/tmp-safe/test.php on line 5

> including copying verbatim all error messages seen
Here, the message was included in my initial email: > PHP Fatal error:  Out of memory (allocated 4194304) (tried to allocate 2097184 bytes) in /c/Users/JackBlower/tmp-safe/test.php on line 5

> - if you're running 32 bit Cygwin, possibly under 32 bit Windows, you have probably run out of heap space from installing too many packages requiring too many DLLs.
Nope all 64-bit, I would've mentioned if not.

> and PHP build configurations and logs.
See the output below for some more info, either way this is a pre-packaged version of PHP with very little changed from default configuration.

------------------------------
> Greetings, km2z7kca0oge--- via Cygwin!
Hey Andrey,

I've tried your script and I hit the 128MB limit, as expected. So maybe it's to do with the `http` wrapper. Could you try my version of the script please and see how you get on?

I first bumped into this problem when I rolled back from composer 2.X to 1.X which uses more memory.

I generated an 800MB file using: ` fsutil file createnew 800mega 838860800` and then ran your script you provided substituting your backup for the 800 MB file I generated.

The output of the script is below:
```
$ ./test-mailing-list.php
#!/usr/bin/env php
<?= file_get_contents(__FILE__);
phpinfo(1);
echo ini_get('memory_limit'), "\n";
print number_format(strlen(file_get_contents('800mega')));
phpinfo();
phpinfo()
PHP Version => 7.3.7

System => CYGWIN_NT-10.0-18363 AML0147 3.1.6-340.x86_64 2020-07-09 08:20 UTC x86_64
Build Date => Jul 21 2019 16:57:32
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
Scan this dir for additional .ini files => /etc/php.d
Additional .ini files parsed => /etc/php.d/bcmath.ini,
/etc/php.d/bz2.ini,
/etc/php.d/curl.ini,
/etc/php.d/fileinfo.ini,
/etc/php.d/gd.ini,
/etc/php.d/gmp.ini,
/etc/php.d/intl.ini,
/etc/php.d/json.ini,
/etc/php.d/ldap.ini,
/etc/php.d/mbstring.ini,
/etc/php.d/pdo_mysql.ini,
/etc/php.d/pdo_pgsql.ini,
/etc/php.d/pdo_sqlite.ini,
/etc/php.d/phar.ini,
/etc/php.d/posix.ini,
/etc/php.d/simplexml.ini,
/etc/php.d/sockets.ini,
/etc/php.d/sodium.ini,
/etc/php.d/sqlite3.ini,
/etc/php.d/tokenizer.ini,
/etc/php.d/vld.ini,
/etc/php.d/xmlwriter.ini,
/etc/php.d/zip.ini,
/etc/php.d/zlib.ini

PHP API => 20180731
PHP Extension => 20180731
Zend Extension => 320180731
Zend Extension Build => API320180731,NTS
PHP Extension Build => API20180731,NTS
Debug Build => no
Thread Safety => disabled
Zend Signal Handling => enabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => disabled

Registered PHP Streams => https, ftps, php, file, glob, data, http, ftp, compress.bzip2, compress.zlib, zip, phar
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters => string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, bzip2.*, zlib.*

This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.3.7, Copyright (c) 1998-2018 Zend Technologies
128M
PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 838869024 bytes) in /c/Users/JackBlower/tmp-safe/test-mailing-list.php on line 5
```

Notice how this time it's running out of memory at 128MB and has the "Allowed memory size" error instead of the "Out of memory" error from before.

Many Thanks,

Jack

             reply	other threads:[~2020-07-18 15:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-18 15:33 km2z7kca0oge [this message]
2020-07-18 17:32 ` Brian Inglis
  -- strict thread matches above, loose matches on Subject: below --
2020-07-21 20:58 km2z7kca0oge
2020-07-18 15:54 km2z7kca0oge
2020-07-17 21:39 km2z7kca0oge
2020-07-17 22:39 ` Brian Inglis
2020-07-18  7:29 ` Andrey Repin
2020-07-19  2:11 ` Ken Brown
2020-07-21 20:45   ` Ken Brown
2020-08-04  1:57     ` Cary Lewis
2020-08-04 10:45       ` Ken Brown
2020-08-04 13:35         ` Cary Lewis
2020-08-04 13:58           ` Ken Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1027954883.77500.1595086445002@smtp4.opayq.com \
    --to=km2z7kca0oge@opayq.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).