Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 15901 invoked from network); 24 Jan 2009 18:27:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jan 2009 18:27:26 -0000 Received: (qmail 28766 invoked by uid 500); 24 Jan 2009 18:27:25 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 28744 invoked by uid 500); 24 Jan 2009 18:27:25 -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 28733 invoked by uid 99); 24 Jan 2009 18:27:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Jan 2009 10:27:25 -0800 X-ASF-Spam-Status: No, hits=2.4 required=10.0 tests=HTML_MESSAGE,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jamisonlists@gmail.com designates 209.85.217.16 as permitted sender) Received: from [209.85.217.16] (HELO mail-gx0-f16.google.com) (209.85.217.16) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Jan 2009 18:27:16 +0000 Received: by gxk9 with SMTP id 9so4870652gxk.0 for ; Sat, 24 Jan 2009 10:26:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=IBJLi8OD7H+O4fw7lqo/XSpmIJHbS/eSrJYGxHbWF30=; b=aQku3QkT/JEWs9S20MWsTwcIH+t4Z9q4DmF5WsTDGf47EejW5yNzyW041FNWm0SfzT 9S7dEPLavzA/Sqp26ax14ZtOcVTsoPL65NYsI0Z2ijexT+jUj/u02dmtLBn0EU4KLRo8 xfW3UjqNZ5hoR6qywbG8l4mbtA8Z0aCcIn9WQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qjHhUnEd9ITRqcSVHvoBX1hd8GpdrzQU3D7qTpmu+xIVTgpMR0gNrtyhyQQS2Kwqin QlEF5ThspcvDV//6BvobpFuEKd/JR9xSIzaHQhYPM8Dru+4xSlPAp5vg99bCFITqGBW7 K+LHVRR+CW2G6NgEf0O9/s4mTh4lArBQb2Z2E= MIME-Version: 1.0 Received: by 10.150.133.18 with SMTP id g18mr1909729ybd.206.1232821615068; Sat, 24 Jan 2009 10:26:55 -0800 (PST) In-Reply-To: <21574300.post@talk.nabble.com> References: <21568317.post@talk.nabble.com> <21568697.post@talk.nabble.com> <21568927.post@talk.nabble.com> <21574300.post@talk.nabble.com> Date: Sat, 24 Jan 2009 12:26:55 -0600 Message-ID: <71d231c70901241026s3814e6cag401f30a4a3ae8c1e@mail.gmail.com> Subject: Re: Excessive memory usage (feature or bug?) From: j-lists To: user-java@ibatis.apache.org Content-Type: multipart/alternative; boundary=000e0cd4856470087e04613ea6d9 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd4856470087e04613ea6d9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit This conversation inspired a rather off-topic question from me, in mysql are you forced to hardcode the limit/offset in to the SQL like this? limit $skip$, $max$ In Postgres they can bind as parameters: limit #limit# offset #offset# I'm not really a mysql user so I am curious... -J On Tue, Jan 20, 2009 at 5:46 PM, Jeff P wrote: > > Thank you alot, Larry!!! > > It really scared the hell out of me when I checked the profiler and saw > that > 1 query used so much memory. > I can confirm that using your technique reduced ram usage to 5mb (which is > practically nothing!) > > Thanks again! > > > Larry Meadors wrote: > > > > Ha, yeah, it's the driver for sure. You'll get the same results if you > > prepare and execute the statement yourself instead of using ibatis. > > > > I remember when looked at the source for the pgsql driver some time > > ago - it does a similar thing - it fetched the results of the query > > into a big freaking byte[][] structure (assuming that you'll need it > > all) then walked through it as I called rs.next(). > > > > Even a RowHandler won't help because it's happening before ibatis gets > > to touch the data - it happens when you execute the statement. > > > > Use the limit trick in your select statement. It's the only way to > > prevent this problem if the driver does this. > > > > Larry > > > > > > On Tue, Jan 20, 2009 at 11:34 AM, Jeff P > wrote: > >> > >> For what its worth... my profiler says the 3 biggest memory hogs are: > >> > > > > > > -- > View this message in context: > http://www.nabble.com/Excessive-memory-usage-%28feature-or-bug-%29-tp21568317p21574300.html > Sent from the iBATIS - User - Java mailing list archive at Nabble.com. > > --000e0cd4856470087e04613ea6d9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit This conversation inspired a rather off-topic question from me, in mysql are you forced to hardcode the limit/offset in to the SQL like this?
limit $skip$, $max$

In Postgres they can bind as parameters:
limit #limit# offset #offset#

I'm not really a mysql user so I am curious...

-J

On Tue, Jan 20, 2009 at 5:46 PM, Jeff P <killingdjef@hotmail.com> wrote:

Thank you alot, Larry!!!

It really scared the hell out of me when I checked the profiler and saw that
1 query used so much memory.
I can confirm that using your technique reduced ram usage to 5mb (which is
practically nothing!)

Thanks again!


Larry Meadors wrote:
>
> Ha, yeah, it's the driver for sure. You'll get the same results if you
> prepare and execute the statement yourself instead of using ibatis.
>
> I remember when looked at the source for the pgsql driver some time
> ago - it does a similar thing - it fetched the results of the query
> into a big freaking byte[][] structure (assuming that you'll need it
> all) then walked through it as I called rs.next().
>
> Even a RowHandler won't help because it's happening before ibatis gets
> to touch the data - it happens when you execute the statement.
>
> Use the limit trick in your select statement. It's the only way to
> prevent this problem if the driver does this.
>
> Larry
>
>
> On Tue, Jan 20, 2009 at 11:34 AM, Jeff P <killingdjef@hotmail.com> wrote:
>>
>> For what its worth... my profiler says the 3 biggest memory hogs are:
>>
>
>

--
View this message in context: http://www.nabble.com/Excessive-memory-usage-%28feature-or-bug-%29-tp21568317p21574300.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


--000e0cd4856470087e04613ea6d9--