mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-05-30 17:05:49 +08:00
- Add 30s (host:port) -> pid cache in ProcessInfoUtils so the synchronous libproc scan stays off the request hot path for keep-alive flows (typical HTTP client reuses the same source port across requests in a connection). - Lift sockView ByteData out of the inner fd loop so the buffer wrapper is reused across all fds in a scan (saves per-fd allocations). - Bail out of the scan after 16 consecutive proc_pidfdinfo size mismatches, in case a future macOS bumps the socket_fdinfo layout -- avoids wasted syscalls instead of scanning every fd just to return null at the end. Re-verified end-to-end on macOS 26.4: 500 concurrent curl, 0 fork leaks, 9099 freed immediately on app exit, no errors in logs.