Built a DLS BitSet that uses bytes the DLS BitSet cache has a maximum size of bytes – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.6-7.15

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch operation.

Briefly, this error occurs when the Document Level Security (DLS) BitSet size exceeds the maximum cache size. DLS BitSet is used for filtering documents based on user permissions. The cache size is limited to prevent excessive memory usage. To resolve this issue, you can either increase the cache size by adjusting the ‘indices.bitset.filter_cache.size’ setting or reduce the complexity of your DLS queries to decrease the BitSet size. However, increasing cache size may impact overall system performance, so it’s important to monitor memory usage closely.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

This guide will help you check for common problems that cause the log ” built a DLS BitSet that uses [{}] bytes; the DLS BitSet cache has a maximum size of [{}] bytes; ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, cache.

Log Context

Log “built a DLS BitSet that uses [{}] bytes; the DLS BitSet cache has a maximum size of [{}] bytes;” classname is DocumentSubsetBitsetCache.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                    // A cache loader is not allowed to return null; return a marker object instead.
                    return NULL_MARKER;
                final long bitSetBytes = result.ramBytesUsed();
                if (bitSetBytes > this.maxWeightBytes) {
                    logger.warn("built a DLS BitSet that uses [{}] bytes; the DLS BitSet cache has a maximum size of [{}] bytes;" +
                            " this object cannot be cached and will need to be rebuilt for each use;" +
                            " consider increasing the value of [{}]";
                        bitSetBytes; maxWeightBytes; CACHE_SIZE_SETTING.getKey());
                } else if (bitSetBytes + bitsetCache.weight() > maxWeightBytes) {


How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?