Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 55037 invoked from network); 22 Jul 2005 10:13:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Jul 2005 10:13:28 -0000 Received: (qmail 19322 invoked by uid 500); 22 Jul 2005 10:13:25 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 19297 invoked by uid 500); 22 Jul 2005 10:13:24 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 19280 invoked by uid 99); 22 Jul 2005 10:13:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2005 03:13:23 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=HTML_50_60,HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of misiek_x@poczta.onet.pl designates 213.180.130.71 as permitted sender) Received: from [213.180.130.71] (HELO smtp11.poczta.onet.pl) (213.180.130.71) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jul 2005 03:13:16 -0700 Received: from polygonatum.man.poznan.pl ([150.254.170.114]:53773 "EHLO polygonatum") by ps11.test.onet.pl with ESMTP id ; Fri, 22 Jul 2005 12:13:17 +0200 Message-ID: <007501c58ea6$14bd41f0$72aafe96@polygonatum> From: "Michal Malecki" To: References: <8A9C57F4-4F4D-48B4-B555-7B65D5EA6766@sun.com> <16178eb10507212019addf2d1@mail.gmail.com> Subject: Re: Estimating amount of memory need for cache Date: Fri, 22 Jul 2005 12:14:00 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0072_01C58EB6.D7DE2860" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1506 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_0072_01C58EB6.D7DE2860 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I think it's not quite so e.g. all characters in the memory are 2 bytes = and serialized there are in UTF-8 here is article about it: http://www.javaworld.com/javaworld/javaqa/2003-12/02-qa-1226-sizeof.html Regards Michal Malecki You could serialize the results it to disk. That would give you a = pessimistic estimation of the size it will be in memory. That is, the = cost of serialization will be higher than the amount of RAM used, so you = can feel relatively confident that it will be smaller in memory. Cheers, Clinton On 7/21/05, Nathan Maves wrote: What is the best and most accurate way to calculate the space needed to cache a query. Say I have a query that returns 5 strings on average of 20 chars = each. The query returns 5000 rows. I know this seems high but just humor me and remember I have access=20 to big servers here at Sun :) Nathan ------=_NextPart_000_0072_01C58EB6.D7DE2860 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,
I think it's not quite so e.g. all = characters in=20 the memory are 2 bytes and serialized there are in UTF-8
here is article about it:
http://www.javaworld.com/javaworld/javaqa/2003-12/02-qa-1226-siz= eof.html
Regards
Michal Malecki

You=20 could serialize the results it to disk.  That would give you a=20 pessimistic estimation of the size it will be in memory.  That = is, the=20 cost of serialization will be higher than the amount of RAM used, so = you can=20 feel relatively confident that it will be smaller in=20 memory.

Cheers,
Clinton

On 7/21/05, Nathan=20 Maves <Nathan.Maves@sun.com> = wrote:
What=20 is the best and most accurate way to calculate the space = needed
to cache=20 a query.

Say I have a query that returns 5 strings on average = of 20=20 chars each.

The query returns 5000 rows.

I know this = seems=20 high but just humor me and remember I have access
to big servers = here at=20 Sun = :)

Nathan

------=_NextPart_000_0072_01C58EB6.D7DE2860--