apache / apache/arrow-java

[Java] Netty memory release

Đang mở
#215 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Type: bug
Ngôn ngữ chính
Java
Star
94
Fork
152
Merge trung bình
3 ngày 16 giờ
Pull request đã merge (30 ngày)
11

Mô tả

### Describe the bug, including details regarding any error messages, version, and platform.

Since when we use netty as my memory allocator manager, I found that direct memory is not released after vector is closed.
```
Field field = new Field("test", FieldType.nullable(new ArrowType.Utf8()), null);
RootAllocator allocator = new RootAllocator(Long.MAX_VALUE);
FieldVector vector = field.createVector(allocator);
for (int i = 0; i < 100000; i++){
((VarCharVector)vector).setSafe(i, "test".getBytes(StandardCharsets.UTF_8));
}

System.out.println("before close memory: " + usedDirectMemory() + " bytes"); //before close memory: 4194304 bytes
vector.close();
allocator.close();
System.out.println("after closed memory: " + usedDirectMemory() + " bytes"); //after closed memory: 4194304 bytes
```
I can address the problem that if the inner allocator `PooledByteBufAllocator` won't free the memory chunk , I am not sure if this is expected.

### Component(s)

Java

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

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

Hướng nghiên cứu

Bắt đầu với bản tái hiện Java được cung cấp bằng cách sử dụng RootAllocator, VarCharVector và PooledByteBufAllocator, sau đó theo dõi hành vi khi đóng allocator và việc xử lý bộ nhớ trực tiếp của Netty. Xác nhận xem phần còn lại 4194304 byte là một rò rỉ thực sự hay hành vi pooling được mong đợi, rồi ghi lại hoặc kiểm thử hành vi mong đợi thu được.

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

Đánh giá

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

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.