apache / apache/arrow-java

[Java] Netty memory release

Ouverte
#215 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Type: bug
Langage dominant
Java
Étoiles
94
Forks
152
Merge moyen
3 j 16 h
PR mergées (30 j)
11

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction Java fournie avec RootAllocator, VarCharVector et PooledByteBufAllocator, puis suivez le comportement lors de la fermeture de l’allocator et la gestion de la mémoire directe par Netty. Confirmez si le reste de 4194304 octets correspond à une fuite réelle ou à un comportement de pooling attendu, et documentez ou testez le comportement attendu qui en résulte.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
performance
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.