Implement ByteArray pool allocator && String pool
Open
A pull request for this has already been merged.
- #72 by @tuhuynh27 — merged
evaluation
help wanted
- Dominant language
- Java
- Stars
- 109
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
Issue: There is a lot of byte[] allocated when handling TCP messages:

It's better to have a ByteArray pool allocator so that byte[] can be reused and avoid creating massive garbage for the GC and the throughput can be even better.
For example:
ByteArrayPoolAllocator pool = ByteArrayPoolAllocator.DEFAULT
byte[10] obj = byteArrayPool.getByteArray(10);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the TCP message handling path and the proposed ByteArrayPoolAllocator example in this issue. Check closed pull request #72 for prior work on the allocator and string pool. Done means the pooling approach is implemented for the relevant allocations and its effect on garbage creation and throughput is validated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, networking, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100