RE: Re: [ADMIN] High memory usage [PATCH]

From: "Dave Cramer" <davec(at)sentricity(dot)com>
To: <gunnar(at)polygnosis(dot)com>
Cc: "'Bruce Momjian'" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "'Rainer Mager'" <rmager(at)vgkk(dot)com>, "'PostgreSQL jdbc list'" <pgsql-jdbc(at)postgresql(dot)org>
Subject: RE: Re: [ADMIN] High memory usage [PATCH]
Date: 2001-06-22 13:19:05
Message-ID: 000001c0fb1d$ee00d830$0201a8c0@INSPIRON
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-jdbc pgsql-patches

On the thread safe issue: I am having a hard time understanding how one
would share a statement across threads. I would expect that threadsafe
just means don't use static buffers so that I can have multiple
statements in multiple threads. I don't think it is possible to have two
threads concurrently doing a query using one statement. This being said,
I don't thing it is necessary to go to great lengths to lock within the
statement as long as all the members within the statement are
non-static.

Comments?

-----Original Message-----
From: gunnar(at)polygnosis(dot)com [mailto:gunnar(at)polygnosis(dot)com]
Sent: June 22, 2001 7:42 AM
To: Dave Cramer
Cc: Bruce Momjian; Rainer Mager; PostgreSQL jdbc list
Subject: Re: [JDBC] Re: [ADMIN] High memory usage [PATCH]

* "Dave Cramer" <Dave(at)micro-automation(dot)net> wrote:
|
| my two cents worth...
|
| 1) what is the problem that this is trying to solve, I assume from the
| subject that it is some sort of high memory usage?

I would like to know as well.

| 2) I am trying to understand how a statement would ever be used by
more than
| one thread at a time? I would think that it would be impossible to
share
| statements across threads.

Quite easy. Just the same way as you share any other object across
threads
and according to the JDBC spec requires that the driver shoudl be thread

safe.

| 3) The double locking method used is alledgedly unsafe on SMP machines
| http://www.javaworld.com/javaworld/jw-02-2001/jw-0209-double_p.html.

Yup, double checked locking is not going to guarantee that you get
properly initialized objects with the current Java spec.

--
Gunnar Rønning - gunnar(at)polygnosis(dot)com
Senior Consultant, Polygnosis AS, http://www.polygnosis.com/

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Gunnar Rønning 2001-06-22 14:02:47 Re: Re: [ADMIN] High memory usage [PATCH]
Previous Message Gunnar Rønning 2001-06-22 11:42:12 Re: Re: [ADMIN] High memory usage [PATCH]

Browse pgsql-jdbc by date

  From Date Subject
Next Message Gunnar Rønning 2001-06-22 14:02:47 Re: Re: [ADMIN] High memory usage [PATCH]
Previous Message Gunnar Rønning 2001-06-22 11:42:12 Re: Re: [ADMIN] High memory usage [PATCH]

Browse pgsql-patches by date

  From Date Subject
Next Message Gunnar Rønning 2001-06-22 14:02:47 Re: Re: [ADMIN] High memory usage [PATCH]
Previous Message Tom Lane 2001-06-22 13:18:55 Re: use GUC for cmdline