Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JBossThread (off-heap) memory footprint due to FastThreadLocal usage #39062

Open
franz1981 opened this issue Feb 28, 2024 · 3 comments
Open

JBossThread (off-heap) memory footprint due to FastThreadLocal usage #39062

franz1981 opened this issue Feb 28, 2024 · 3 comments
Labels

Comments

@franz1981
Copy link
Contributor

franz1981 commented Feb 28, 2024

The blocking thread pool of Quarkus is extending Netty's FastThreadLocalThread for several reasons (@cescoffier knows more on this), but it leads to 2 problems:

Ideally if jboss-thread(s) Threads won't be FastThreadLocalThreads it will just work fine, because useCacheForAllThreads is false by default. Another option, instead, similar to #39061, is to use heap-based unpooled buffers, but given that core jboss-thread(s) are long living, will likely impact performance.

There's another option to investigate which periodically schedule trimming of thread local caches (see https://github.com/netty/netty/blob/4ba1c3e7e190bdc9bdd0ece237042f16e843c797/buffer/src/main/java/io/netty/buffer/PooledByteBufAllocator.java#L127-L145), but sadly it will be applied to event loops/I/O threads too, which is not something we want (I believe).

@franz1981 franz1981 added the kind/bug Something isn't working label Feb 28, 2024
@franz1981 franz1981 changed the title JBossThread memory footprint and risk of CVE/OOM due to FastThreadLocal usage JBossThread memory footprint and risk of OOM due to FastThreadLocal usage Feb 28, 2024
@franz1981 franz1981 changed the title JBossThread memory footprint and risk of OOM due to FastThreadLocal usage JBossThread (off-heap) memory footprint due to FastThreadLocal usage Feb 28, 2024
@franz1981
Copy link
Contributor Author

@vietj too

@quarkus-bot
Copy link

quarkus-bot bot commented Feb 29, 2024

/cc @Sanne (core), @aloubyansky (core), @gsmet (core), @radcortez (core), @stuartwdouglas (core)

@Sanne
Copy link
Member

Sanne commented Mar 1, 2024

Great find. I migth be wrong, but this seems very important to urgently - labelling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants