apache / apache/arrow-java

[Java] Netty memory release

オープン
#215 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Type: bug
主要言語
Java
スター
94
フォーク
152
平均マージ
3日 16時間
マージ済み PR(30日)
11

説明

### 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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

RootAllocator、VarCharVector、PooledByteBufAllocatorを使用した提供済みのJava再現コードから始め、続いてallocatorのクローズ動作とNettyのダイレクトメモリ処理を追跡してください。残っている4194304バイトが実際のリークなのか、予期されたプーリング動作なのかを確認し、その結果として期待される動作を文書化またはテストしてください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
performance
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。