迁移后Cakephp内存限制报错,排查Controller

Cakephp memory limit error after migration, troubleshooting Controller

我正在 copying/migrating 将生产服务器 Cakephp 2.3.8 项目转换为开发项目,但我遇到了著名的错误:

Blockquote Fatal Error Error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 200648563 bytes) File: /var/www/html/lib/Cake/Utility/String.php Line: 243

Notice: If you want to customize this error message, create app/View/Errors/fatal_error.ctp

我已经镜像了与生产服务器相同的规格:

这主要发生在我访问某些控制器时,因为我能够(显然)正确加载某些页面。

我目前正在根据日志文件调试应用程序的行为:

但是 none 其中显示了致命错误限制的更多详细信息,有人告诉我这可能是内存泄漏,如果两个服务器都以相同的方式限制,那怎么办? (以下服务器的 ulimit)。


我想知道问题是什么,我缺少设置吗?我怎样才能将 Controller 调整为 运行 而不会出错?

开发服务器规格

生产服务器



提前致谢

更新 1
这是将 lib/Cake/View/Errors/fatal_error.ctp 复制到 app/View/Errors/fatal_error.ctp 并添加后显示的内容
<pre><?php echo h($error->getTraceAsString()); ?></pre>

Fatal Error Error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 126212148 bytes) File: /var/www/html/lib/Cake/Utility/String.php Line: 243

Notice: If you want to customize this error message, create app/View/Errors/fatal_error.ctp

July 9th '20 Update

#0 /var/www/html/lib/Cake/Error/ErrorHandler.php(184): ErrorHandler::handleFatalError(1, 'Allowed memory ...', '/var/www/html/l...', 243)

#1 [internal function]: ErrorHandler::handleError(1, 'Allowed memory ...', '/var/www/html/l...', 243, Array)

#2 /var/www/html/lib/Cake/Core/App.php(931): call_user_func('ErrorHandler::h...', 1, 'Allowed memory ...', '/var/www/html/l...', 243, Array)

#3 /var/www/html/lib/Cake/Core/App.php(904): App::_checkFatalError()

#4 [internal function]: App::shutdown()

#5 {main}

在此之前,我正在取出一些组件和助手:

var $helpers=array("Js","Html","Form","Paginator","Fck","Cache","Pagination");
var $components=array("Customcomponent","Paginator","RequestHandler","Cookie","Pagination","Email");

但是运气不好(收到相同的错误消息),我的其他可用控制器不使用助手,仅使用以下组件:
var $components=array("Customcomponent","RequestHandler","Cookie","Email","Pagination","Paginator");

不清楚调用什么 String.php Line: 243,完整的调用堆栈可能有帮助

lib/Cake/View/Errors/fatal_error.ctp复制到app/View/Errors/fatal_error.ctp并添加

<pre><?php echo h($error->getTraceAsString()); ?></pre>