wp-cli / doctor-command

Diagnose problems within WordPress by running a series of checks for symptoms
MIT License
145 stars 22 forks source link

mmap() failed: [12] Cannot allocate memory when running check cache-flush #178

Closed jordantrizz closed 11 months ago

jordantrizz commented 1 year ago

Bug Report

Describe the current, buggy behavior

The check "cache-flush" has issues when the wp-content folder has many files, the site that was affected had 40,000 files in the wp-content directory.

Describe how other contributors can replicate this bug

Run wp doctor check cache-flush

Describe what you would expect as the correct outcome

Only scan .php or rebuild the function so that it doesn't exceed memory limits.

Let us know what environment you are running this on

❯ wp cli info
OS:     Linux 4.15.0-134-generic #138-Ubuntu SMP Fri Jan 15 10:52:18 UTC 2021 x86_64
Shell:  /usr/bin/zsh
PHP binary:     /usr/local/lsws/lsphp74/bin/php
PHP version:    7.4.33
php.ini used:   /usr/local/lsws/lsphp74/etc/php/7.4/litespeed/php.ini
MySQL binary:   /usr/bin/mysql
MySQL version:  mysql  Ver 14.14 Distrib 5.7.41, for Linux (x86_64) using  EditLine wrapper
SQL modes:      ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /home/dev/public_html/wp-content/uploads
WP-CLI packages dir:    /root/.wp-cli/packages/
WP-CLI cache dir:       /root/.wp-cli/cache
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.7.1
danielbachhuber commented 1 year ago

Thanks for the report, @jordantrizz !

Feel free to submit a pull request, if you'd like. Here is some guidance on our pull request best practices, if it's helpful.

jordantrizz commented 1 year ago

I would love to address this, but time is an issue, and I'm still mediocre at programming at best. So I'd have to take some time to figure out how best to implement the change.

danielbachhuber commented 11 months ago

🔨