Trying to avoid / cache buffer allocation when serializing object

Shay Banon kimchy at gmail.com
Thu Aug 26 06:43:57 EDT 2010


Hi,

   I was wondering if there is a nice way to try and avoid buffer allocation
when serializing objects. I have my own way of serializing objects, but the
idea is very similar to ObjectEncoder, which allocates a new buffer for each
written message. I understand that its very difficult to serialize directly
to the socket in non blocking IO, but was wondering if there is a good way
to not allocate a buffer each time but maybe reuse buffers.

   I could build my own cache of buffers, get one before writing and release
it when the write is completed. Wondering if there is a better way to do
it...

-shay.banon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20100826/54d2092d/attachment.html 


More information about the netty-users mailing list