Recommended way of decoding non-framed messages?

brunodecarvalho kindernade at gmail.com
Sun Aug 1 19:48:31 EDT 2010


Benoit,


You can find the source code for netty here:
http://docs.jboss.org/netty/3.2/xref/

Regarding the paragraph you quoted from JLS, do you have any idea as to why
it is "prohibitively expensive" to store the stack trace?

I've used Exception-as-constant approach only one or two times before (much
like ChannelFuture's CANCELLED exception,
http://docs.jboss.org/netty/3.2/xref/org/jboss/netty/channel/DefaultChannelFuture.html#45)
and running a couple of tests now I found out that this exception will
always store the stack trace of the code that initialized it or called it
for the first time (either to be thrown or returned).

So if this Exception-constant is called from a long stack the first time,
that stack will be preserved. If, on the other hand, some static
initialization code takes care of initializing it (throwing it or just call
something like .getClass() on the constant) the stored stack will be rather
small (and - I supposed - occupy less memory).


Bruno
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Recommended-way-of-decoding-non-framed-messages-tp5357958p5362288.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list