Wraps openFds() and returns a multi-line string suitable for warning or error messages. By default summarizes only fds at or above fdSelectLimit() (the select() failure threshold); pass threshold = 0L to summarize everything.

openFdsReport(threshold = fdSelectLimit())

Arguments

threshold

integer. Only fds at or above this number are bucketed. Defaults to fdSelectLimit().

Value

character scalar; "" if /proc/self/fd is not available.

Examples

cat(openFdsReport())
#> Open fds: 23 total, max = 145, 0 at or above threshold (1024).
cat(openFdsReport(threshold = 0L))
#> Open fds: 23 total, max = 145, 23 at or above threshold (0).
#> High-fd holders (count, example):
#>   pipe                         11   e.g. pipe:[42729]
#>   anon_inode                    4   e.g. anon_inode:[eventpoll]
#>   socket                        4   e.g. socket:[40726]
#>   other file                    2   e.g. /home/runner/work/_temp/34adc2b7-52f7-4d43-81b3-58c549a74aca
#>   sqlite                        1   e.g. /usr/share/proj/proj.db
#>   unknown                       1   e.g. NA