cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Lerer (Jira)" <>
Subject [jira] [Updated] (CASSANDRA-15880) Memory leak in CompressedChunkReader
Date Tue, 30 Jun 2020 15:09:00 GMT


Benjamin Lerer updated CASSANDRA-15880:
    Fix Version/s: 3.11.x

> Memory leak in CompressedChunkReader
> ------------------------------------
>                 Key: CASSANDRA-15880
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Feature/Compression
>            Reporter: Jaroslaw Grabowski
>            Priority: Normal
>             Fix For: 4.0, 3.11.x
> CompressedChunkReader uses java.lang.ThreadLocal to reuse ByteBuffer for compressed data.
ByteBuffers leak due to peculiar ThreadLocal quality.
> ThreadLocals are stored in a map, where the key is a weak reference to a ThreadLocal
and the value is the user's object (ByteBuffer in this case). When a last strong reference
to a ThreadLocal is lost, weak reference to ThreadLocal (key) is removed but the value (ByteBuffer)
is kept until cleaned by ThreadLocal heuristic expunge mechanism. See ThreadLocal's "stale
entries" for details.
> When a number of long-living threads is high enough this results in thousands of ByteBuffers
stored as stale entries in ThreadLocals. In a not-so-lucky scenario we get OutOfMemoryException.

This message was sent by Atlassian Jira

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message