Closed phperzhangdongliang closed 1 month ago
Your software version (Screenshot of your startup)
Component | Version | +---------------------------+---------+ | PHP | 8.1.4 | | Swoole | 5.1.2 | | LaravelS | 3.7.38 | | Laravel Framework [local] | 10.31.0
Detail description about this issue(error/log)
在register_providers中添加了\App\Providers\RouteServiceProvider::class,会出现内存泄漏问题,注释掉就没有内存泄漏了,这个怎么处理呢?一下是用检测方法检测的内存变化 {"prev_mem":25157592,"curr_mem":25159888,"diff_mem":2296} {"prev_mem":25159888,"curr_mem":25161544,"diff_mem":1656} {"prev_mem":25161544,"curr_mem":25163200,"diff_mem":1656} {"prev_mem":25163200,"curr_mem":25164856,"diff_mem":1656} {"prev_mem":25164856,"curr_mem":25232048,"diff_mem":67192} {"prev_mem":25232048,"curr_mem":25233704,"diff_mem":1656} {"prev_mem":25233704,"curr_mem":25235360,"diff_mem":1656} {"prev_mem":25235360,"curr_mem":25237016,"diff_mem":1656}
Some reproducible code blocks and steps
reproducible
steps
'register_providers' => [ \App\Providers\RouteServiceProvider::class //每次请求重新加载一次路由 ],
@hhxsv5
为啥会重新注册RouteServiceProvider?这个应该只注册一次的
因为之前写的一些逻辑需要重新加载路由,现在改了写法,已经解决
Your software version (Screenshot of your startup)
Component | Version | +---------------------------+---------+ | PHP | 8.1.4 | | Swoole | 5.1.2 | | LaravelS | 3.7.38 | | Laravel Framework [local] | 10.31.0
Detail description about this issue(error/log)
在register_providers中添加了\App\Providers\RouteServiceProvider::class,会出现内存泄漏问题,注释掉就没有内存泄漏了,这个怎么处理呢?一下是用检测方法检测的内存变化 {"prev_mem":25157592,"curr_mem":25159888,"diff_mem":2296} {"prev_mem":25159888,"curr_mem":25161544,"diff_mem":1656} {"prev_mem":25161544,"curr_mem":25163200,"diff_mem":1656} {"prev_mem":25163200,"curr_mem":25164856,"diff_mem":1656} {"prev_mem":25164856,"curr_mem":25232048,"diff_mem":67192} {"prev_mem":25232048,"curr_mem":25233704,"diff_mem":1656} {"prev_mem":25233704,"curr_mem":25235360,"diff_mem":1656} {"prev_mem":25235360,"curr_mem":25237016,"diff_mem":1656}
Some
reproducible
code blocks andsteps
'register_providers' => [ \App\Providers\RouteServiceProvider::class //每次请求重新加载一次路由 ],