Re: Experiences with pl/Java

From: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
To: Thomas Hill <Thomas(dot)K(dot)Hill(at)t-online(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Experiences with pl/Java
Date: 2012-11-19 16:26:56
Message-ID: CAEYLb_Xgmi743Hq6AOyqNhqFB-NYBjZpyAwT2JLjHGWZ8_hLFQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 19 November 2012 08:02, Thomas Hill <Thomas(dot)K(dot)Hill(at)t-online(dot)de> wrote:
> was wondering if there is anyone wanted to share some experiences gained and
> some knowledge on pl/Java. Have looked into it for a couple of days now and
> am getting the impression it is not something ready to use in production
> environment. Also have trouble sending to the developer mailing list (the
> last email on the mail archive of that list is almost three weeks old) which
> raises questions on how active this project is.

I'd caution you against using pl/java in production. I came up against
a problem with it that I could not find a satisfactory solution for.

Essentially, each Postgres backend (connection process) must start its
own JVM, and does so using the JNI. If native memory runs out (I
realise that this may not actually be due to malloc() returning NULL,
but the effect is about the same), this failure is handled rather
poorly. It results in an OutOfMemoryError due to "native memory
exhaustion". This results in a segfault of the Postgres backend,
originating from within libjvm.so. There is a workaround - which is to
set the maximum JVM heap size to a sufficiently low value - but in
general the need to do so left me with a very low opinion of pl/java
as a project.

--
Peter Geoghegan http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vlad 2012-11-19 16:50:25 Re: High SYS CPU - need advise
Previous Message Tom Lane 2012-11-19 15:30:46 Re: Prepared Statement Name Truncation