Viewing a single comment thread. View all comments

WindTalk wrote (edited )

Reply to comment by bootes in 404 errors with index.php by bootes

4GB of memory? I'm running fine on 0.8GB. It isn't even touching that. With apache2.

What is top telling you? is it PostgreSQL using all the memory or nginx? Try apache2?

1

bootes OP wrote

Im not sure on top, I'll give that a check. But the error Im getting is

Fatal error: Out of memory (allocated 17039360) (tried to allocate 77824 bytes) in /postmill

I have my php.ini memory limit set to -1

1

WindTalk wrote

Fatal error: Out of memory (allocated 17039360) (tried to allocate 77824 bytes) in /postmill

That's only 17MB. Maybe post output of: cat /proc/meminfo

1

bootes OP wrote

ok. Finally got the exact error:

2018/02/28 07:39:51 [error] 2158#2158: *17 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /Postmill/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php on line 109
PHP message: PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in /Postmill/vendor/symfony/debug/Exception/OutOfMemoryException.php on line 1" while reading response header from upstream, client: 192.168.1.100, server: 192.168.1.109, request: "GET /login HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "192.168.1.106"
$  cat /proc/meminfo
MemTotal:        4039996 kB
MemFree:         1599136 kB
MemAvailable:    2040880 kB
Buffers:           84896 kB
Cached:           579648 kB
SwapCached:            0 kB
Active:           622112 kB
Inactive:         447528 kB
Active(anon):     439524 kB
Inactive(anon):    30144 kB
Active(file):     182588 kB
Inactive(file):   417384 kB
Unevictable:     1210420 kB
Mlocked:         1210420 kB
SwapTotal:       1043964 kB
SwapFree:        1043964 kB
Dirty:                 4 kB
Writeback:             0 kB
AnonPages:       1615536 kB
Mapped:           116184 kB
Shmem:             36372 kB
Slab:             117284 kB
SReclaimable:      89756 kB
SUnreclaim:        27528 kB
KernelStack:        4336 kB
PageTables:        13224 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     3063960 kB
Committed_AS:    2435176 kB
VmallocTotal:   34359738367 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
HardwareCorrupted:     0 kB
AnonHugePages:    212992 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       71616 kB
DirectMap2M:     4122624 kB
1

WindTalk wrote

Allowed memory size of 134217728 bytes exhausted

128MB is standard memory limit for PHP, and apps like Drupal run fine with that amount. So, I'm thinking something else. However, try removing the limit

  1. run "php --ini" to confirm you are using the INI you think you are. What's your version of php? "php -v"
  2. Just to see if problem goes away, change memory_limit in php.ini to -1 and see if that changes behavior.
1

bootes OP wrote

my memory limit is -1 already. php 7.2 using the php.ini located under the 7.2 directory.

2

bootes OP wrote

php -v

PHP 7.2.2-3+ubuntu17.10.1+deb.sury.org+1 (cli) (built: Feb 6 2018 16:11:55) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.2-3+ubuntu17.10.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

php -ini

$ php -i-ini phpinfo() PHP Version => 7.2.2-3+ubuntu17.10.1+deb.sury.org+1

System => Linux reddit 4.13.0-32-generic #35-Ubuntu SMP Thu Jan 25 09:13:46 UTC 2018 x86_64 Build Date => Feb 6 2018 16:11:55 Server API => Command Line Interface Virtual Directory Support => disabled Configuration File (php.ini) Path => /etc/php/7.2/cli Loaded Configuration File => /etc/php/7.2/cli/php.ini

$ cat /etc/php/7.2/cli/php.ini | grep 'memory_limit'

memory_limit = -1

2