Re: Web app + Tomcat + MS SQL Server + Desktop Applications = Mysterious db write locks every few weeks?
- From: JC <jason.cipriani@xxxxxxxxx>
- Date: Mon, 29 Dec 2008 01:08:58 -0800 (PST)
Thanks a lot, I really appreciate your reply.
On Dec 29, 3:02 am, neune...@xxxxxxxx wrote:
Hi,
On Dec 25, 3:37 am, JC <jason.cipri...@xxxxxxxxx> wrote:
...
2) Has anybody ever had an issue like this? Even remotely similar,
related to the combination of web applications, Hibernate, Tomcat, MS
SQL, etc, that involve database locks not being released or other
strange things happening after very long periods of time?
Well, I've experienced and fixed that *kind* of behavior
6 months ago or so.
It is a (not well-known) *fact* that there are issues involving
Hibernate and the Sun VM.
In my case it was a very weird PermGen space error (weird because
there was plenty or PermGen memory) fixed simply by passing the
following parameter "XX:MaxPermSize=256m" (IIRC).
You know, come to think of it, I have seen the web application run out
of permgen space on the development machine in the past, even though I
felt like it shouldn't have (I was dealing with small amounts of data,
and this web application is relatively simple, nothing exotic), but I
chalked it off to other things at the time, and it was very rare. I
never thought about it again. I wonder if it is similar to what's
going on on the production machine.
The behavior was as you describe: restarting Tomcat would fix the
problem... For a few weeks.
Any information at all would be useful. It's tough to debug because
the timescale is so large, and because restarting the web server fixes
it (so it's not possible to update the web app with new debugging
output when it happens).
Because restarting the web server in our case "fixed"
the problem and because having customers was more
important than having the "perfect application
running on a perfect VM in a perfect OS etc." we first
scheduled an automatic Tomcat restart every 72 hours ;)
This was a crappy fix, but for our startup it was better
than to be out of business.
Agreed; although it will be good to find out if it's a bug in third-
party software rather than a bug in our own software. The former can
be acceptably "solved" with automatic restarts, the latter should
probably be solved at the root cause instead.
Later on I found the exact cause of our problem: a weird
Hibernate + Sun VM (known and documented) bug (Google is
your friend) easily "fixed" by using a bigger PermGen
space (once again I stress that this was a *bug* and that
the default PermGen settings were supposed to be plenty,
but because of that hibernate + Sun VM bug it wasn't).
Interesting; I'm reading a bit about it now. Another solution that
seems to be suggested is switching VMs; maybe JRockit or something.
That is, assuming that's the issue in the first place.
Simply forcing the use of a bigger PermGen space fixed
the problem. Uptime of Tomcat instances (on several
machines) is now in months.
Of course we're unnecessarily lost some memory due to
a weird "Hibernate + Sun VM" bug, but memory is cheap :)
Don't know if you've got the exact same problem, hope
it helps,
Well, I've cranked it up to 512MB, we'll see if it's still running in
a few weeks (a crystal ball would greatly increase my productivity
here). Once I figure out how, I'll also periodically log / check free
permgen space to see if I can spot a leak.
Thanks again,
Jason
.
- References:
- Prev by Date: Re: Web app + Tomcat + MS SQL Server + Desktop Applications = Mysterious db write locks every few weeks?
- Next by Date: Re: Simple compilation problem (2)
- Previous by thread: Re: Web app + Tomcat + MS SQL Server + Desktop Applications = Mysterious db write locks every few weeks?
- Next by thread: Re: Web app + Tomcat + MS SQL Server + Desktop Applications = Mysterious db write locks every few weeks?
- Index(es):
Relevant Pages
|