ThinkPHP5 读取文件并入库过程中的内存超出错误
2022-07-28 14:14:58
190
{{single.collect_count}}

在使用thinkphp5 编写读取目录文件并入库程序的过程中,因为读取文件都在40w以上,造成php内存超出上限的错误
1、可能因为insertAll 每次写入数据限制过多或过少,大概1w左右最佳
2、可能因为thinkphp存储日志机制占用了内存,直接将thinkphp/library/think/Log.php 里的 record改为下图
在这里插入图片描述

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}