[FEA] Leak tracking for Java Scalar instances
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
**Is your feature request related to a problem? Please describe.**
The Java bindings require explicit `close()` calls by the caller to prevent GPU OOM errors if garbage collection doesn't kick in often enough to free unreferenced Java objects wrapping GPU resources in a timely manner. We currently have leaked object tracking via weak reference collection events for most GPU resources, but that does not currently cover `Scalar` instances which wrap `cudf::scalar`.
**Describe the solution you'd like**
The same leak tracking and debugging done for `ColumnVector` should be applied to `Scalar`. Although `Scalar` instances are not very large in practice (excluding the corner cases of nested type scalars), they can fragment the GPU memory pool drastically if there are enough of these tiny allocations leaked, causing GPU OOM errors much earlier than one would expect.
Contributor guide
Assessment
This issue has not been assessed yet.