Allowed memory size exhausted message, indicates that a single PHP request has consumed the defined memory_limit value. Having free RAM on the server does not change this limit. First, find the consumption-causing plugin, query, or process; then, adjust the suitable WordPress and PHP limits in a balanced way.
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted
tried to allocate 4096 bytes
wp-includes/class-wpdb.php on line ...
PHP memory_limit is the maximum amount of memory each PHP process can use. WP_MEMORY_LIMIT sets the value WordPress requires for normal operations, while WP_MAX_MEMORY_LIMIT sets the upper value for some operations on the management side.
Having 64 GB of RAM on the server does not prevent a single PHP request from exceeding the 128 MB limit. Conversely, setting the limit too high can cause all RAM of concurrent PHP processes to be consumed.
The 'tried to allocate' value in the log is not the total requirement; it is the last additional amount requested after the process limit is full. The actual consumer should be found in the stack trace and file.
WooCommerce import, large image processing, Elementor editor, backup and report plugins may consume more memory than regular pages. Management limit should be evaluated separately.
Object cache, large autoload option records and infinite query loops can increase memory usage. If it increases again after the limit is raised, the root issue has not been resolved.
memory_limit=-1 is not a safe solution in a live hosting environment. PHP-FPM worker count and process per thread limit should be calculated together.
Search for the phrase you see in the email, browser, or SSH log. Each card includes meaning, probable cause, and safe initial action.
Meaning: PHP has reached the memory_limit value for the request.
Possible cause: Heavy plugin, large data, loop, or low limit.
Meaning: Shows the requested final amount after the limit is reached.
Possible cause: Does not show the total memory requirement alone.
Meaning: PHP or the operating system cannot allocate memory.
Possible cause: PHP limit, global RAM or OOM.
Meaning: WordPress Is Using Lower Request for Normal Operations.
Possible cause: wp-config constant or default value
Meaning: The management process has exceeded the WordPress limit.
Possible cause: Import, update, report or editor.
Meaning: Large image processing ran out of memory.
Possible cause: High resolution, Imagick/GD and low limits.
Meaning: Seeing WooCommerce below recommended value limit
Possible cause: Web PHP and CLI PHP settings may be different.
Meaning: Kernel killed the PHP process due to global RAM pressure.
Possible cause: Excessive worker, swap absence, or memory leak.
No records matching this expression were found.
Commands are for root access. Collect only status and logs first; Do not change the permanent setting without seeing the reason.
php -r 'echo ini_get("memory_limit"), PHP_EOL;'
CLI shows the effective memory_limit value.
wp config get WP_MEMORY_LIMIT 2>/dev/null
wp config get WP_MAX_MEMORY_LIMIT 2>/dev/null
Is a custom limit defined in wp-config?
wp eval 'echo WP_MEMORY_LIMIT." / ".WP_MAX_MEMORY_LIMIT.PHP_EOL;'
Shows the normal and admin limits seen by WordPress.
wp db query "SELECT option_name,LENGTH(option_value) boyut FROM wp_options WHERE autoload='yes' ORDER BY boyut DESC LIMIT 20;"
Detect autoloaded large options; warn if prefix is different.
ps -eo pid,user,%mem,rss,etime,cmd --sort=-rss | grep -E 'php-fpm|lsphp' | head -n 30
Displays the most RAM-consuming PHP processes.
journalctl -k --since '2 hours ago' | grep -Ei 'oom|out of memory|killed process'
Separates PHP limit due to global RAM depletion.
The root cause of the WordPress error is the same, but log paths, PHP settings screens and service management vary depending on the hosting infrastructure used.
cPanel's MultiPHP INI Editor and MultiPHP Manager manage web PHP values.
php -r 'echo ini_get("memory_limit"), PHP_EOL;'The Plesk PHP Settings page sets memory_limit domain-wise.
cd /var/www/vhosts/ALANADI/httpdocs && wp eval 'echo WP_MEMORY_LIMIT;'In a panel-less server, php.ini, FPM pool, and worker capacity are calculated together.
php --ini && systemctl list-units 'php*-fpm.service' --no-pagerMeasure the real web PHP limit, find the error log, isolate the consuming component and set controlled limits with capacity billing.
Record the error that occurs in the plugin, theme, or core call.
tail -n 150 wp-content/debug.logThe PHP in the browser and the SSH php command can use different ini files.
php --iniImport, editor or cron job with controlled plugin isolation for testing.
wp plugin list --status=activeUse a reasonable WP_MEMORY_LIMIT/WP_MAX_MEMORY_LIMIT for normal and admin operations.
Compare max_children and total RAM with the actual RSS at the beginning of the process.
ps -eo rss,cmd --sort=-rss | grep php-fpm | headVerify peak usage, log, and global RAM behavior.
Admin memory, number of extensions, and large template data are examined.
Divide the file into parts, check the batch size and Action Scheduler.
Large pixel size, Imagick policy and thumbnail generation are inspected.
Memory leak, loop, or very large autoload data is investigated.
This is not just PHP memory_limit but a global OOM issue.
journalctl -k | grep -Ei 'oom|killed process'No. PHP's memory_limit is the upper limit; WordPress's setting is the value requested by the application and cannot exceed PHP's upper limit.
It varies by site and process type; 128–256 MB is common, but actual process consumption and server capacity should be measured.
PHP applies a separate memory limit for each operation.
No; the limit is the desired amount after the limit is filled.
Import, report, product variation and admin tasks can consume more resources than a standard blog.
Usually no; it only resolves memory shortages. Excessively high limits can cause global RAM pressure.
WordPress identifies higher memory requirements for some heavy operations on the administration side.
By analyzing cPanel, WHM, CloudLinux, LiteSpeed, MariaDB, Exim and security layers together, we fix the root cause of the failure instead of just removing the service.