agora inbox for pljava-dev@postgresql.orghelp / color / mirror / Atom feed
[Pljava-dev] postmaster hangs if JVM does not close nicely in windows 2+ messages / 0 participants [nested] [flat]
* [Pljava-dev] postmaster hangs if JVM does not close nicely in windows @ 2011-11-04 12:40 2011-11-04 21:46 ` [Pljava-dev] postmaster hangs if JVM does not close nicely in windows 0 siblings, 1 reply; 2+ messages in thread From: @ 2011-11-04 12:40 UTC (permalink / raw) I came across an interesting problem the other day using pl/Java. ?When I deployed my application in Linux everything worked just fine but when I ran it under Windows, every client connection would leave a postmaster process running, and shutting down the PostgreSQL 9.1 service would fail. I finally traced it back to the fact that the services I was running in the JVM were not shutting down when the client disconnected (the finalize() method was not being called) and so the file resources they'd locked were not being released and the JVM process would not stop. ?This hung the postmaster process for each client connection (along with ~80MB of memory) and became a problem pretty quickly. I ended up creating a patch for pl/Java that allowed me to get a Java event right before the JVM is destroyed (the onDestroyJavaVM event) which I could use to clean up and shutdown the services running, before pl/Java tried to stop the JVM. ?This may be useful to anyone else who is running complex Java services inside their database, so I have attached my patch to the issue Tracker here: http://pgfoundry.org/tracker/index.php?func=detail&aid=1011111&group_id=1000038&atid=336 Nathan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20111104/b1ea3aac/attachment.html; ^ permalink raw reply [nested|flat] 2+ messages in thread
* [Pljava-dev] postmaster hangs if JVM does not close nicely in windows 2011-11-04 12:40 [Pljava-dev] postmaster hangs if JVM does not close nicely in windows @ 2011-11-04 21:46 ` 0 siblings, 0 replies; 2+ messages in thread From: @ 2011-11-04 21:46 UTC (permalink / raw) Nathan Egge <nathanegge at yahoo.com> writes: > I ended up creating a patch for pl/Java that allowed me to get a > Java event right before the JVM is destroyed (the onDestroyJavaVM > event) which I could use to clean up and shutdown the services > running, before pl/Java tried to stop the JVM. This may be useful > to anyone else who is running complex Java services inside their > database, so I have attached my patch to the issue Tracker here: Before applying that patch, I'd like to see it documented somewhere, somehow, how to use it. Can you write a short description of this facility? > http://pgfoundry.org/tracker/index.php?func=detail&aid=1011111&group_id= > 1000038&atid=336 -- Johann Oskarsson http://www.2ndquadrant.com/ |[] PostgreSQL Development, 24x7 Support, Training and Services --+-- | Blog: http://my.opera.com/myrkraverk/blog/ ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2011-11-04 21:46 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2011-11-04 12:40 [Pljava-dev] postmaster hangs if JVM does not close nicely in windows 2011-11-04 21:46 `
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox