Open GoogleCodeExporter opened 9 years ago
I admit this is an annoying warning and there is a small memory leak (1KB)
because the ThreadLocal never gets released when running in the container
thread. However, this is not as bad as the gson issue because the thread local
variable is an array of primitive (char[]), i.e., there's no chained
application-order classloaders prevented in memory.
Other the other hand, the performance gain of this cached buffer is
considerable as the escaping functionality is constantly used. We could have
provided a clean-up helper method so that users of the library can choose to
free the buffer as they like. However, there's layers and layers of other code
that wrap this library, we have to either add such a helper at every layer, or
users at the far end wouldn't know how/when to use this low level API.
So, it's a tradeoff between performance and usability to me.
Original comment by wonder...@google.com
on 30 Dec 2014 at 9:56
Original issue reported on code.google.com by
cmayn...@gmail.com
on 17 Dec 2014 at 8:53