Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-8231

Wrong size of cached prepared statements

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 2.1.3
    • Legacy/CQL
    • None
    • Normal

    Description

      Cassandra counts memory footprint of prepared statements for caching purposes. It seems, that there is problem with some statements, ie SelectStatement. Even simple selects is counted as 100KB object, updates, deletes etc have few hundreds or thousands bytes. Result is that cache - QueryProcessor.preparedStatements - holds just fraction of statements..

      I dig a little into the code, and it seems that problem is in jamm in class MemoryMeter. It seems that if instance contains reference to class, it counts size of whole class too. SelectStatement references EnumSet through ResultSet.Metadata and EnumSet holds reference to Enum class...

      Attachments

        1. 8231-notes.txt
          26 kB
          Robert Stupp
        2. Unsafes.java
          16 kB
          Robert Stupp
        3. CASSANDRA-8231.txt
          58 kB
          Benjamin Lerer
        4. CASSANDRA-8231-V2.txt
          81 kB
          Benjamin Lerer
        5. CASSANDRA-8231-V2-trunk.txt
          81 kB
          Benjamin Lerer

        Activity

          People

            blerer Benjamin Lerer
            shinigami Jaroslav Kamenik
            Benjamin Lerer
            Dave Brosius
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: