Hello,
This bug has bitten our server some times last 30 days. Any idea what could be causing this?
Wowza Media Server 3.1.2.16 build3037
OS - Ubuntu 12.04
RAM - 16 Gb
CPU - Intel E3-1230V2 (Cores 4, Threads 8)
Text of last error this morning
java.lang.OutOfMemoryError: Java heap space
at java.nio.HeapByteBuffer.(HeapByteBuffer.java:57)
at java.nio.ByteBuffer.allocate(ByteBuffer.java:331)
at org.apache.mina.common.SimpleByteBufferAllocator.allocate(Unknown Source)
at org.apache.mina.common.ByteBuffer.allocate(Unknown Source)
at org.apache.mina.transport.socket.nio.SocketIoProcessor.read(Unknown Source)
at org.apache.mina.transport.socket.nio.SocketIoProcessor.process(Unknown Source)
at org.apache.mina.transport.socket.nio.SocketIoProcessor.access$600(Unknown Source)
at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(Unknown Source)
at org.apache.mina.util.NamePreservingRunnable.run(Unknown Source)
at java.lang.Thread.run(Thread.java:722)
WARN server comment 2013-05-13 04:20:09 - - - - - 585159.535 - - - - - - - - Unexpected exception.
java.lang.OutOfMemoryError: Java heap space
WARN server comment 2013-05-13 04:21:40 - - - - - 585250.66 - - - - - - - - Unexpected exception.
java.lang.OutOfMemoryError: Java heap space
WARN server comment 2013-05-13 04:23:04 - - - - - 585351.49 - - - - - - - - nullUnexpected exception from exceptionCaught handler.
java.lang.OutOfMemoryError: Java heap space
WARN server comment 2013-05-13 04:24:03 - - - - - 585396.621 - - - - - - - - Unexpected exception.
java.lang.OutOfMemoryError: Java heap space
WARN server comment 2013-05-13 04:23:42 - - - - - 585377.031 - - - - - - - - nullUnexpected exception from exceptionCaught handler.
java.lang.NullPointerException
[install-dir]/bin/setenv.bat
_EXECJAVA=java
JAVA_OPTS=“-Xmx8000M”
Uncomment to run server environment (faster), Note: will only work if server VM install, comes with JDL
JAVA_OPTS=“$JAVA_OPTS -server”
Can be a better GC setting to avoid long pauses
JAVA_OPTS=“$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:NewSize=512m”
Uncomment to log debug garbage collection information
#NOW=$(date +“%Y-%m-%d-%H-%M”)
JAVA_OPTS=“$JAVA_OPTS -verbose:gc -Xloggc:”/usr/local/WowzaMediaServer/logs/gc_$NOW.log" -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC"
Uncomment to write heap dump on OutOfMemoryError
#JAVA_OPTS=“$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/usr/local/WowzaMediaServer”
Uncomment to force Java to use specific language settings
#JAVA_OPTS=“$JAVA_OPTS -Duser.language=en -Duser.country=US -Dfile.encoding=Cp1252”
Uncomment to fix multicast crosstalk problem when streams share multicast port
JAVA_OPTS=“$JAVA_OPTS -Djava.net.preferIPv4Stack=true”
WMSAPP_HOME=/usr/local/WowzaMediaServer
WMSCONFIG_HOME=/usr/local/WowzaMediaServer
WMSCONFIG_URL=
export WMSAPP_HOME WMSCONFIG_HOME JAVA_OPTS _EXECJAVA
[install-dir]/conf/VHost.xml
<Root> <VHost> <HostPortList> <HostPort> <ProcessorCount>4</ProcessorCount> <IpAddress>*</IpAddress> <!-- Separate multiple ports with commas --> <!-- 80: HTTP, RTMPT --> <!-- 554: RTSP --> <Port>1935</Port> <SocketConfiguration> <ReuseAddress>true</ReuseAddress> <!-- suggested settings for video on demand applications --> <ReceiveBufferSize>65000</ReceiveBufferSize> <SendBufferSize>65000</SendBufferSize> <!-- suggest settings for low latency chat and video recording applications <ReceiveBufferSize>32000</ReceiveBufferSize> <SendBufferSize>32000</SendBufferSize> --> <KeepAlive>true</KeepAlive> <!-- <TrafficClass>0</TrafficClass> --> <!-- <OobInline>false</OobInline> --> <!-- <SoLingerTime>-1</SoLingerTime> --> <!-- <TcpNoDelay>false</TcpNoDelay> --> <AcceptorBackLog>100</AcceptorBackLog> </SocketConfiguration> <HTTPStreamerAdapterIDs>cupertinostreaming,smoothstreaming,sanjosestreaming,dvrchunkstreaming</HTTPStreamerAdapterIDs> <HTTPProviders> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPCrossdomain</BaseClass> <RequestFilters>*crossdomain.xml</RequestFilters> <AuthenticationMethod>none</AuthenticationMethod> </HTTPProvider> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPClientAccessPolicy</BaseClass> <RequestFilters>*clientaccesspolicy.xml</RequestFilters> <AuthenticationMethod>none</AuthenticationMethod> </HTTPProvider> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPProviderMediaList</BaseClass> <RequestFilters>*jwplayer.rss|*jwplayer.smil|*medialist.smil|*manifest-rtmp.f4m</RequestFilters> <AuthenticationMethod>none</AuthenticationMethod> </HTTPProvider> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPServerVersion</BaseClass> <RequestFilters>*</RequestFilters> <AuthenticationMethod>none</AuthenticationMethod> </HTTPProvider> </HTTPProviders> </HostPort> <!-- 443 with SSL --> <!-- <HostPort> <ProcessorCount>4</ProcessorCount> <IpAddress>*</IpAddress> <Port>443</Port> <SSLConfig> <KeyStorePath>${com.wowza.wms.context.VHostConfigHome}/conf/keystore.cert</KeyStorePath> <KeyStorePassword>[password]</KeyStorePassword> <KeyStoreType>JKS</KeyStoreType> <SSLProtocol>TLS</SSLProtocol> <Algorithm>SunX509</Algorithm> <CipherSuites></CipherSuites> <Protocols></Protocols> </SSLConfig> <SocketConfiguration> <ReuseAddress>true</ReuseAddress> <ReceiveBufferSize>24000</ReceiveBufferSize> <SendBufferSize>65000</SendBufferSize> <KeepAlive>true</KeepAlive> <AcceptorBackLog>100</AcceptorBackLog> </SocketConfiguration> <HTTPStreamerAdapterIDs>cupertinostreaming,smoothstreaming,sanjosestreaming,dvrchunkstreaming</HTTPStreamerAdapterIDs> <HTTPProviders> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPCrossdomain</BaseClass> <RequestFilters>*crossdomain.xml</RequestFilters> <AuthenticationMethod>none</AuthenticationMethod> </HTTPProvider> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPClientAccessPolicy</BaseClass> <RequestFilters>*clientaccesspolicy.xml</RequestFilters> <AuthenticationMethod>none</AuthenticationMethod> </HTTPProvider> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPProviderMediaList</BaseClass> <RequestFilters>*jwplayer.rss|*jwplayer.smil|*medialist.smil|*manifest-rtmp.f4m</RequestFilters> <AuthenticationMethod>none</AuthenticationMethod> </HTTPProvider> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPServerVersion</BaseClass> <RequestFilters>*</RequestFilters> <AuthenticationMethod>none</AuthenticationMethod> </HTTPProvider> </HTTPProviders> </HostPort> --> <!-- Admin HostPort --> <HostPort> <ProcessorCount>1</ProcessorCount> <IpAddress>*</IpAddress> <Port>8086</Port> <SocketConfiguration> <ReuseAddress>true</ReuseAddress> <ReceiveBufferSize>16000</ReceiveBufferSize> <SendBufferSize>16000</SendBufferSize> <KeepAlive>true</KeepAlive> <AcceptorBackLog>100</AcceptorBackLog> </SocketConfiguration> <HTTPStreamerAdapterIDs></HTTPStreamerAdapterIDs> <HTTPProviders> <HTTPProvider> <BaseClass>com.wowza.wms.http.streammanager.HTTPStreamManager</BaseClass> <RequestFilters>streammanager*</RequestFilters> <AuthenticationMethod>admin-digest</AuthenticationMethod> </HTTPProvider> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPServerInfoXML</BaseClass> <RequestFilters>serverinfo*</RequestFilters> <AuthenticationMethod>admin-digest</AuthenticationMethod> </HTTPProvider> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPConnectionInfo</BaseClass> <RequestFilters>connectioninfo*</RequestFilters> <AuthenticationMethod>admin-digest</AuthenticationMethod> </HTTPProvider> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPConnectionCountsXML</BaseClass> <RequestFilters>connectioncounts*</RequestFilters> <AuthenticationMethod>admin-digest</AuthenticationMethod> </HTTPProvider> <HTTPProvider> <BaseClass>com.wowza.wms.transcoder.httpprovider.HTTPTranscoderThumbnail</BaseClass> <RequestFilters>transcoderthumbnail*</RequestFilters> <AuthenticationMethod>admin-digest</AuthenticationMethod> </HTTPProvider> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPProviderMediaList</BaseClass> <RequestFilters>medialist*</RequestFilters> <AuthenticationMethod>admin-digest</AuthenticationMethod> </HTTPProvider> <HTTPProvider> <BaseClass>com.wowza.wms.http.HTTPServerVersion</BaseClass> <RequestFilters>*</RequestFilters> <AuthenticationMethod>none</AuthenticationMethod> </HTTPProvider> </HTTPProviders> </HostPort> </HostPortList> <HTTPStreamerAdapters> <HTTPStreamerAdapter> <ID>smoothstreaming</ID> <Name>smoothstreaming</Name> <Properties> </Properties> </HTTPStreamerAdapter> <HTTPStreamerAdapter> <ID>cupertinostreaming</ID> <Name>cupertinostreaming</Name> <Properties> </Properties> </HTTPStreamerAdapter> <HTTPStreamerAdapter> <ID>sanjosestreaming</ID> <Name>sanjosestreaming</Name> <Properties> </Properties> </HTTPStreamerAdapter> <HTTPStreamerAdapter> <ID>dvrchunkstreaming</ID> <Name>dvrchunkstreaming</Name> <Properties> </Properties> </HTTPStreamerAdapter> </HTTPStreamerAdapters> <HandlerThreadPool> <PoolSize>120</PoolSize> </HandlerThreadPool> <TransportThreadPool> <PoolSize>80</PoolSize> </TransportThreadPool> <IdleWorkers> <WorkerCount>4</WorkerCount> <CheckFrequency>50</CheckFrequency> <MinimumWaitTime>5</MinimumWaitTime> </IdleWorkers> <NetConnections> <ProcessorCount>4</ProcessorCount> <IdleFrequency>250</IdleFrequency> <SocketConfiguration> <ReuseAddress>true</ReuseAddress> <ReceiveBufferSize>65000</ReceiveBufferSize> <SendBufferSize>24000</SendBufferSize> <KeepAlive>true</KeepAlive> <!-- <TrafficClass>0</TrafficClass> --> <!-- <OobInline>false</OobInline> --> <!-- <SoLingerTime>-1</SoLingerTime> --> <!-- <TcpNoDelay>false</TcpNoDelay> --> <AcceptorBackLog>100</AcceptorBackLog> </SocketConfiguration> </NetConnections> <HTTPTunnel> <KeepAliveTimeout>2000</KeepAliveTimeout> </HTTPTunnel> <Client> <ClientTimeout>90000</ClientTimeout> <IdleFrequency>250</IdleFrequency> </Client> <!-- RTP/Authentication/Methods defined in Authentication.xml. Default setup includes; none, basic, digest --> <RTP> <IdleFrequency>75</IdleFrequency> <DatagramConfiguration> <Incoming> <ReuseAddress>true</ReuseAddress> <ReceiveBufferSize>1024000</ReceiveBufferSize> <SendBufferSize>65000</SendBufferSize> <!-- <MulticastBindToAddress>true</MulticastBindToAddress> --> <!-- <MulticastInterfaceAddress>192.168.1.22</MulticastInterfaceAddress> --> <!-- <TrafficClass>0</TrafficClass> --> <MulticastTimeout>50</MulticastTimeout> <DatagramMaximumPacketSize>4096</DatagramMaximumPacketSize> </Incoming> <Outgoing> <ReuseAddress>true</ReuseAddress> <ReceiveBufferSize>65000</ReceiveBufferSize> <SendBufferSize>65000</SendBufferSize> <!-- <MulticastBindToAddress>true</MulticastBindToAddress> --> <!-- <MulticastInterfaceAddress>192.168.1.22</MulticastInterfaceAddress> --> <!-- <TrafficClass>0</TrafficClass> --> <MulticastTimeout>50</MulticastTimeout> <DatagramMaximumPacketSize>4096</DatagramMaximumPacketSize> </Outgoing> </DatagramConfiguration> <UnicastIncoming> <ProcessorCount>4</ProcessorCount> </UnicastIncoming> <UnicastOutgoing> <ProcessorCount>8</ProcessorCount> </UnicastOutgoing> <MulticastIncoming> <ProcessorCount>4</ProcessorCount> </MulticastIncoming> <MulticastOutgoing> <ProcessorCount>4</ProcessorCount> </MulticastOutgoing> </RTP> <Application> <ApplicationTimeout>60000</ApplicationTimeout> <PingTimeout>12000</PingTimeout> <ValidationFrequency>20000</ValidationFrequency> <MaximumPendingWriteBytes>0</MaximumPendingWriteBytes> <MaximumSetBufferTime>60000</MaximumSetBufferTime> </Application> <StartStartupStreams>true</StartStartupStreams> <!-- Properties defined here will be added to the IVHost.getProperties() collection --> <Properties> </Properties> </VHost> </Root>
[install-dir]/bin/wms.sh
ulimit -n 20000
[install-dir]/bin/startup.sh
ulimit -n 20000 > /dev/null 2>&1
/etc/sysctl.conf
fs.file-max=20000
Thanks!