Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0FEBE101EF for ; Wed, 19 Nov 2014 08:16:41 +0000 (UTC) Received: (qmail 89397 invoked by uid 500); 19 Nov 2014 08:16:34 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 89298 invoked by uid 500); 19 Nov 2014 08:16:34 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 89006 invoked by uid 99); 19 Nov 2014 08:16:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Nov 2014 08:16:34 +0000 Date: Wed, 19 Nov 2014 08:16:34 +0000 (UTC) From: "Benjamin Lerer (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-8231) Wrong size of cached prepared statements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-8231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Lerer updated CASSANDRA-8231: -------------------------------------- Attachment: CASSANDRA-8231.txt This patch replace the jamm version 0.2.8 by the version 0.3.0 which support the {{Unmetered}} annotation on type. The {{ignoreKnownSingleton}} option of {{MemoryMeter}} was already excluding {{Class}} and {{Enum}} instances. So only the {{CFMetadata}}, {{AbstractType}} and {{Function}} had to be marked with the {{Unmetered}} annotation. I used the {{enableDebug}} option from {{MemoryMeter}} to verify that the measured instances were the expected ones. > Wrong size of cached prepared statements > ---------------------------------------- > > Key: CASSANDRA-8231 > URL: https://issues.apache.org/jira/browse/CASSANDRA-8231 > Project: Cassandra > Issue Type: Bug > Components: Core > Reporter: Jaroslav Kamenik > Assignee: Benjamin Lerer > Attachments: 8231-notes.txt, CASSANDRA-8231.txt, Unsafes.java > > > 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... -- This message was sent by Atlassian JIRA (v6.3.4#6332)