tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Crowther" <>
Subject RE: Very Long Full GC after Inactivity
Date Wed, 10 Oct 2007 10:45:00 GMT
> From: Bill Clarke-Fields [] 
> If it turns out to be so, is there
> anything I can do to force it to not page out the JVM heap?

There's cheap and there's messy :-).

The cheap way: Set up a job that runs overnight that exercises your app.
It should keep the critical files paged in.

The messy way: Run Tomcat as an admin (ick!) and make a JNI call to some
native code that pins Tomcat's address space into RAM.  I have not tried
this, don't know whether there's a "correct" JVM way of doing it, and
have *no* idea how it might interact with Sun's address space
management!  It's something to try very, very cautiously - this might
bite you in unexpected ways.

The cheap *and* messy way: Use Task Manager to boost Tomcat's priority
to realtime.  I *think* that pins the process' address space into RAM,
although check as I'm stating this from memory and my memory is erratic
these days.  Things will get very unpleasant if Tomcat manages to take
100% CPU on all your cores at once, as a Realtime process is running at
higher priority than the UI so you'd have no way to interrupt it.  On
modern multi-core processors, that's less of an issue - set the Affinity
mask for Tomcat *before* raising the priority so there's at least one
core it's not allowed to run on, and you'll be able to regain control.
As I say, not sure this will work, but it's an interesting tactic to try

Side note: Does your app also use a database?  On which machine?  Is
your database server also being paged out, adding to the slowness?  If
it's SQL Server, it'll be requested to drop cache pages instead as the
system comes under memory pressure, so the heap will quietly shrink...

		- Peter

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message