Skip to content

AutomatonQuery#ramBytesUsed double-counts the underlying Automaton #16389

Description

@Sasilekha

Description

Description

AutomatonQuery#ramBytesUsed adds automaton.ramBytesUsed() and
compiled.ramBytesUsed() unconditionally:

this.ramBytesUsed =
    BASE_RAM_BYTES + term.ramBytesUsed() + automaton.ramBytesUsed() + compiled.ramBytesUsed();

The over-report equals automaton.ramBytesUsed() exactly.

ramBytesUsed() feeds LRUQueryCache eviction decisions; over-reporting causes premature evictions.

Same bug shape as #16046, which fixed the analogous double-count inside CompiledAutomaton itself.

Version and environment details

Lucene: main (Version.LATEST = LUCENE_11_0_0), commit 2b23728
Also present in: 10.x and 9.x branches
JDK / OS: reproducible on any supported JDK/OS — the bug is in pure Java accounting logic

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions