Re: Experiences with pl/Java - Mailing list pgsql-general

From Peter Geoghegan
Subject Re: Experiences with pl/Java
Date
Msg-id CAEYLb_Xgmi743Hq6AOyqNhqFB-NYBjZpyAwT2JLjHGWZ8_hLFQ@mail.gmail.com
Whole thread Raw
In response to Experiences with pl/Java  (Thomas Hill <Thomas.K.Hill@t-online.de>)
Responses Re: Experiences with pl/Java  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
List pgsql-general
On 19 November 2012 08:02, Thomas Hill <Thomas.K.Hill@t-online.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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Maintaining state across function calls
Next
From: Achilleas Mantzios
Date:
Subject: Re: Experiences with pl/Java