app_profiler icon indicating copy to clipboard operation
app_profiler copied to clipboard

`AppProfiler::Server` instances leak with reforking enabled

Open casperisfine opened this issue 2 years ago • 0 comments

I've noticed some File Descriptor growth in molds on pods with reforking enabled:

image

Using a heap dump and harb I was able to map it to AppProfiler::Server:

harb> rootpath 0x7f7d2327a568
root path to 0x7f7d2327a568:
                      ROOT (end_proc)
                      0x7f7d23279c30 (DATA: proc)
                      0x7f7cecb3f658 (OBJECT: AppProfiler::Server::ProfileServer)
                      0x7f7d2327a7e8 (OBJECT: AppProfiler::Server::ProfileServer::UNIX)
                      0x7f7d2327a568 (FILE: (null))

harb> rootpath 0x7f7cb1171c88
root path to 0x7f7cb1171c88:
                      ROOT (end_proc)
                      0x7f7cb1171670 (DATA: proc)
                      0x7f7d22654608 (OBJECT: AppProfiler::Server::ProfileServer)
                      0x7f7cb1171e18 (OBJECT: AppProfiler::Server::ProfileServer::UNIX)
                      0x7f7cb1171c88 (FILE: (null))

(showing only two instances here, but there is about one per generation.

I suspect the server need to be explicitly closed after fork.

casperisfine avatar Sep 24 '23 09:09 casperisfine