Re: new String(byte[]) performance

From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: "Barry Lind" <blind(at)xythos(dot)com>, "Teofilis Martisius" <teo(at)teohome(dot)lzua(dot)lt>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: new String(byte[]) performance
Date: 2002-10-22 20:32:58
Message-ID: 020e01c27a0a$36a50040$4201a8c0@beeblebrox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Barry Lind <blind(at)xythos(dot)com> wrote:

> Teofilis Martisius wrote:
> > On Mon, Oct 21, 2002 at 07:38:07PM -0700, Barry Lind wrote:
> >
> > Hmm, I know how all this works. I read JDBC driver code. However, I did
> > not find much better solution. First, when transfering data from stream,
> > the only logical solution is to put int into byte[]. And as far as I
> > understand byte[] arrays are already pooled. I doubt it is
> > posible/better to read other things than byte[] from the stream.
> >
>
> byte[] objects are not pooled. As for the rest of your email I will
> think about the options you have laid out and respond in more detail
later.

IIRC, the jvm at least in the newest versions does object pooling itself for
some classes. Maybe for byte[] two. There are some documents on the Sun Java
homepage that discourage from using object pools for anything that is not
related to external resources (like a database connection). They say the
internal algorithms are more efficient and object pooling can disturb the
generational garbage collection.

I am not sure about this. In older books I always read about pooling
everything, but nowadays there seem to be many opinions against it. At least
with modern JVMs. Anyone who has deeper knowledge of the topic or some
significant experience?

Best Regards,
Michael Paesold

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2002-10-22 21:14:00 Re: [PATCHES] Anoter JDBC Error
Previous Message Barry Lind 2002-10-22 17:42:44 Re: new String(byte[]) performance