Commit 810943c
authored
fix(java): fix deflater memory leak (#3726)
## Why?
A large number of `Fory` instances on `COMPATIBLE` mode or large amount
and size object meta result in native memory leak.
Native memory allocated by `libzip.so` won't be cleaned unitl next GC,
making many `64M` memory chunks staying in memory space.
## What does this PR do?
Explicitly close native memory allocated by libzip.so.
Decompress method is fixed in #3472. Only compress method should be
fixed.
## Related issues
## AI Contribution Checklist
- [ ] Substantial AI assistance was used in this PR: `no`
- [ ] If `yes`, I included a completed [AI Contribution
Checklist](https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs)
in this PR description and the required `AI Usage Disclosure`.
- [ ] If `yes`, my PR description includes the required `ai_review`
summary and screenshot evidence of the final clean AI review results
from both fresh reviewers on the current PR diff or current HEAD after
the latest code changes.
## Does this PR introduce any user-facing change?
- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?
## Benchmark1 parent d34c5aa commit 810943c
1 file changed
Lines changed: 7 additions & 3 deletions
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
0 commit comments