I've been experimenting with some CATALINA_OPTS changes, as recommended by our webapp developer, and one of them is causing Tomcat to "crash on takeoff" with stacktraces like this:
30-Jul-2018 22:58:00.708 SEVERE [main] org.apache.coyote.AbstractProtocol.init
    Failed to initialize end point associated with ProtocolHandler 
["http-nio-80"]
 java.net.SocketException: Cannot allocate memory
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:433)
        at sun.nio.ch.Net.bind(Net.java:425)
        at 
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:210)
        at 
org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:970)
. . .

We're running on a Google Compute instance, with 1 CPU and 4G of memory, running the Debian version of Tomcat 8.5.14, with Manager showing a JVM is "1.8.0_171-8u171-b11-1~deb9u1-b11."

The "baseline" CATALINA_OPTS, that we'd been using, is
-Xms512m -Xmx2524m -XX:MaxPermSize=256m
-XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC
-XX:+CMSPermGenSweepingEnabled

(And yes, I know that MaxPermSize is obsolete and deprecated in Java 8.)

What the webapp developer asked for was (after I'd vetted his request against the Java 8 docs)
-Xms2048m -Xmx2048m -XX:+ScavengeBeforeFullGC -XX:+AlwaysPreTouch
-XX:+CMSScavengeBeforeRemark -XX:+CMSClassUnloadingEnabled
-XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled

which produced the crash-on-takeoff, and I was able to narrow it down to specifically the "-XX:+AlwaysPreTouch" that was doing it.

Anybody have any insights into why that parameter would cause Tomcat to crash on takeoff?

--
JHHL

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to