Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Java compression codecs do not release compressed ArrowBuf in decompress, causing allocator leaks

Đang mở
#1,037 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
data

Hướng nghiên cứu

Xác định đường dẫn giải nén của codec nén chứa loadFieldBuffers, vòng lặp giải nén và ownBuffers. Di chuyển vòng lặp vào bên dưới phần dọn dẹp try-finally hiện có, sau đó xác minh rằng lỗi xảy ra sau khi các buffer trước đó được giải nén sẽ khiến BufferAllocator còn số bộ nhớ đã cấp phát bằng không, trong khi đường dẫn thành công vẫn giữ các buffer trong vector trường.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Type: bug
bug

When using Arrow Java’s compression codecs (e.g. ZSTD) from downstream projects, we observed that an OutOfMemoryError: Direct buffer memory during decompression can leave the associated BufferAllocator in a leaked state (its allocated memory never returns to zero after the failing operation).

In our case this surfaced in Apache Fluss (see apache/fluss#2646), but after investigation the root cause appears to be in Arrow Java’s compression codec implementation:

Image
version

18.3.0

Solve

In the original Arrow implementation, the decompression loop runs outside the try-finally block that guards loadFieldBuffers. This means if decompression succeeds for the first N buffers of a field but fails on the (N+1)-th buffer, the already-decompressed buffers in ownBuffers are never closed, leaking Direct Memory.

To fix it, move the decompression loop inside the try block so that the finally clause always closes every buffer in ownBuffers, regardless of whether the load succeeds or fails:

  • Success path: loadFieldBuffers retains each buffer (ref count +1), then the finally close decrements it back (ref count -1). The field vector still holds the buffer.
  • Error path: The finally close decrements each already-decompressed buffer's ref count to 0, immediately freeing the Direct Memory.
Ngôn ngữ chính
Java
Star
95
Fork
154
Merge trung bình
2 ngày 10 giờ
Pull request đã merge (30 ngày)
11

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/arrow-java

Tất cả issue của apache/arrow-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.