On Mon, Sep 9, 2024 at 1:25 PM Marlon Patrick <
marlonp...@gmail.com> wrote:
>
> Hi everyone, I would like to ask for help on the best alternative to RecyclerPool for use with Java 21 Virtual Threads.
Hi! I am not the best person to answer but since others haven't yet
shared their knowledge I'll try to comment.
>
> From what I've researched, there have already been two attempts to change the default pool:
> - newLockFreePool: permanently aborted and deprecated
Correct: it turned out to have nasty asymmetric behavior in some
cases, essentially growing unbounded (reuse
failing but adding/returning to pool succeeding) causing OOMEs.
Reproducible with some tests.
This was bizarre and very unfortunate; implementation was simple and
seemed good.
> - newConcurrentDequePool: apparently postponed to 3.0
Correct: due to lack of information on behavior on regular threads it
seems best to require explicit configuration
by virtual thread users.
> Regarding newConcurrentDequePool, in the issue
https://github.com/FasterXML/jackson-core/issues/1266 the following comment was made: ThreadLocal-based pool still performs best for pre-Loom threading.
>
> In this case, I would really appreciate it if you could clarify some doubts:
>
> What about an application using virtual threads? Did you notice any problems with newConcurrentDequePool() when used in conjunction with virtual threads?
> In the 3.0 release, you think the default will be newConcurrentDequePool() or you are considering another alternative?
My hope is that this implementation, or something yet to add, would
take over ThreadLocal-based pool.
> For Jackson 2.17.x, is newConcurrentDequePool() the recomended approach with virtual threads?
At this point that is the assumption but I have not heard much
feedback from anyone on actual real-world
usage, unfortunately.
-+ Tatu +-
>
> --
> You received this message because you are subscribed to the Google Groups "jackson-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
jackson-user...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/jackson-user/87690fa3-fd67-4386-aefd-1ee9dc1154a5n%40googlegroups.com.