Connection leak xảy ra khi ứng dụng mở connection mà không đóng (phổ biến trong framework có connection pool).
Channel leak tương tự.
Triệu chứng: số connection/channel tăng dần, cạn kiệt file handle, connection mới bị reject.
Phòng ngừa:
- Dùng connection pooling;
- Dùng try-finally hoặc try-with-resources để đảm bảo gọi close();
- Monitor và alert khi count tăng;
- Set heartbeat timeout để phát hiện dead connection;
- Giới hạn connection per application
Debug bằng management UI xem IP/user nào đang leak.