Commit Graph

8 Commits

Author SHA1 Message Date
Aliaksandr Valialkin 00868f2226 Use separate pools for request and response bodies.
This should reduce potential memory waste related to byte buffers' pool usage.
2016-06-24 15:15:59 +03:00
Aliaksandr Valialkin 775eb9d43f Update according to bytebufferpool new API 2016-06-24 14:59:39 +03:00
Aliaksandr Valialkin 3148999d1e Updated bytebufferpool calls according to the latest modifications 2016-06-23 11:08:30 +03:00
Aliaksandr Valialkin 8ca66d3de8 Use github.com/valyala/bytebufferpool, which should protect against memory fragmentation in the pool of byte buffers like mentioned in the PR #102 2016-06-22 20:32:00 +03:00
Aliaksandr Valialkin 1fc1f4cbf5 Reduce memory usage under high load by pooling request/response bodies.
- Use request/response body pools.
- Defer request/response body allocation until it is really required.
- Return request/response bodies to the pool as soon as they become unused.

This minimizes the total amount of memory occupied by active request/response
bodies under high load.
2016-06-03 16:54:22 +03:00
Aliaksandr Valialkin 00f18757ec Added Reset method to ByteBuffer 2016-02-12 13:56:07 +02:00
Aliaksandr Valialkin 6210374fa8 Implement io.Writer in ByteBuffer and use it instead of bytes.Buffer in isFileCompressible 2016-02-11 19:36:43 +02:00
Aliaksandr Valialkin 8757b644eb Exported ByteBuffer 2016-02-11 12:12:37 +02:00