ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j-lists <jamisonli...@gmail.com>
Subject Re: Excessive memory usage (feature or bug?)
Date Sat, 24 Jan 2009 18:26:55 GMT
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.
>
>

Mime
View raw message