rschmitt opened a new pull request, #645:
URL: https://github.com/apache/httpcomponents-client/pull/645
The HTTP client builders always construct a client with a non-null cookie
spec registry; if a custom instance is not specified, then the builders will
use `CookieSpecSupport.createDefault()`, which loads the full public suffix
list. The PSL rules are stored on the heap as a `ConcurrentHashMap`, i.e. a
giant array (16,384 on my machine) containing map entries, each of which is
also allocated as a separate object on the heap. This is a considerable number
of live objects that the garbage collector may need to trace. I ran a simple
microbenchmark to show the effects of loading the PSL on garbage collection
(these numbers are from JDK 1.8):
GC took 2 ms
GC took 2 ms
GC took 2 ms
Loading public suffix list... done (took 193 ms)
GC took 11 ms
GC took 8 ms
GC took 7 ms
This is potentially a significant amount of tail latency for use cases that
don't require cookie management, such as RPC calls. With this change, it is now
possible to configure and construct a client that does not load the PSL into
memory.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]