You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Konstantin Preißer <ve...@t-online.de> on 2012/04/27 16:51:58 UTC

Websocket Questions

Hi all,

I'm using Tomcat 7.0.27 with Native 1.1.23 on Windows Server 2008 32-bit with Java 1.7.0_03.

Recently I started a project which uses Websockets. It is a simple app where the clients submit the current mouse position to the server, and the server then broadcasts the position of that user to all other connected users.

To see how the Websocket Implementation in Tomcat works, I read the Chat example (http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_27/webapps/examples/WEB-INF/classes/websocket/chat/ChatWebSocketServlet.java) from Johno Crawford.

1.
It seems that the connector's "connectionTimeout" attribute is used to determine when the Websocket connection should be closed after inactivity. Is this intended? At first, I wondered why Tomcat closes the Websocket connection after a relative short time of about 20 seconds, until I realized that the default server.xhml has a connectionTimeout of 20000.

2. Is there experience of using the HTTP APR connector with Websockets? When I tried to use Websockets with that connector, the JVM crashed in tcnative-1.dll some minutes after Tomcat was started:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x1000476d, pid=3144, tid=9820
#
# JRE version: 7.0_03-b05
# Java VM: Java HotSpot(TM) Client VM (22.1-b02 mixed mode, sharing windows-x86 )
# Problematic frame:
# C  [tcnative-1.dll+0x476d]
#
# Core dump written. Default location: C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27\bin\hs_err_pid3144.mdmp
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

When I switched to HTTP BIO however, everything worked fine.


Thanks!

Regards,
Konstantin Preißer


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


RE: Websocket Questions

Posted by Konstantin Preißer <ve...@t-online.de>.
Hi Mark,
thank you for your reply.

> -----Original Message-----
> From: Mark Thomas [mailto:markt@apache.org]
> Sent: Friday, April 27, 2012 5:37 PM
> To: Tomcat Users List
> Subject: Re: Websocket Questions
> 
> 
> At the moment, yes. There is probably a need for a separate timeout but
> there needs to be a timeout. You can use ping messages to avoid it.

Ok, thanks for the clarification.

> 
> The full stack would be useful. It might point to where things are
> going
> wrong.

Below is the full content of the hs_err_pid3144.log file. This Tomcat instance only had the Websocket application running. It seems it is not hard to reproduce the crash - when I tried it today with HTTP APR again (and Java 1.7.0_04), Tomcat crashed after ~3 mins. In my Websockets App, I create a dedicated thread for each client that sends messages to the client (so that only one thread writes to a specific WsOutbound - I hope this is not forbidden ;-) ). This is the thread in the stack trace, so it seems the error occurs when writing to the Socket. 

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x1000476d, pid=7584, tid=4604
#
# JRE version: 7.0_04-b20
# Java VM: Java HotSpot(TM) Client VM (23.0-b21 mixed mode, sharing windows-x86 )
# Problematic frame:
# C  [tcnative-1.dll+0x476d]  Java_org_apache_tomcat_jni_Socket_send+0x8d
#
# Core dump written. Default location: C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27\bin\hs_err_pid7584.mdmp
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x00e19000):  JavaThread "Thread-48" daemon [_thread_in_native, id=4604, stack(0x049b0000,0x04a00000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000020

Registers:
EAX=0x00000000, EBX=0x04e4d230, ECX=0x049fd7d4, EDX=0x00000000
ESP=0x049fd7b8, EBP=0x049ff7d8, ESI=0x00e19128, EDI=0x049fd7d4
EIP=0x1000476d, EFLAGS=0x00010246

Top of Stack: (sp=0x049fd7b8)
0x049fd7b8:   049fd7d4 049fd7d0 00e19000 049ff804
0x049fd7c8:   00000000 049ff7fc 00000001 049ff881
0x049fd7d8:   1000489d 049ff80c 00000000 30303030
0x049fd7e8:   6c63227b 4e737361 22656d61 6241223a
0x049fd7f8:   61727473 654d7463 67617373 6f4d2f65
0x049fd808:   4d657375 6465766f 7373654d 22656761
0x049fd818:   6c63222c 746e6569 3a226449 222c3632
0x049fd828:   333a2278 222c3134 323a2279 307d3030 

Instructions: (pc=0x1000476d)
0x1000474d:   57 50 8b 45 1c 50 51 8b 8a 20 03 00 00 56 ff d1
0x1000475d:   8b 53 18 8d 85 f8 df ff ff 50 8b 43 0c 8b cf 51
0x1000476d:   8b 4a 20 50 ff d1 8b f0 eb 61 50 ff 15 94 44 0b
0x1000477d:   10 8b f8 83 c4 04 85 ff 75 16 8d 47 f4 5f 5e 5b 


Register to memory mapping:

EAX=0x00000000 is an unknown value
EBX=0x04e4d230 is an unknown value
ECX=0x049fd7d4 is pointing into the stack for thread: 0x00e19000
EDX=0x00000000 is an unknown value
ESP=0x049fd7b8 is pointing into the stack for thread: 0x00e19000
EBP=0x049ff7d8 is pointing into the stack for thread: 0x00e19000
ESI=0x00e19128 is an unknown value
EDI=0x049fd7d4 is pointing into the stack for thread: 0x00e19000


Stack: [0x049b0000,0x04a00000],  sp=0x049fd7b8,  free space=309k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [tcnative-1.dll+0x476d]  Java_org_apache_tomcat_jni_Socket_send+0x8d
J  org.apache.tomcat.jni.Socket.send(J[BII)I
J  org.apache.coyote.http11.upgrade.UpgradeAprProcessor.write(I)V
v  ~StubRoutines::call_stub
V  [jvm.dll+0x1296da]
V  [jvm.dll+0x1d837e]
V  [jvm.dll+0x1298c3]
V  [jvm.dll+0x129927]
V  [jvm.dll+0xd24af]
V  [jvm.dll+0x149987]
V  [jvm.dll+0x149af0]
V  [jvm.dll+0x17df89]
C  [msvcr100.dll+0x5c6de]  endthreadex+0x3a
C  [msvcr100.dll+0x5c788]  endthreadex+0xe4
C  [kernel32.dll+0x4d309]  BaseThreadInitThunk+0x12
C  [ntdll.dll+0x41603]  RtlInitializeExceptionChain+0x63
C  [ntdll.dll+0x415d6]  RtlInitializeExceptionChain+0x36

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J  org.apache.tomcat.jni.Socket.send(J[BII)I
J  org.apache.coyote.http11.upgrade.UpgradeAprProcessor.write(I)V
J  org.apache.catalina.websocket.WsOutbound.doWriteBytes(Ljava/nio/ByteBuffer;Z)V
J  org.apache.catalina.websocket.WsOutbound.doWriteText(Ljava/nio/CharBuffer;Z)V
J  org.apache.catalina.websocket.WsOutbound.writeTextMessage(Ljava/nio/CharBuffer;)V
J  test.MyWebsocketServlet$TestMessageInbound$1.run()V
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
=>0x00e19000 JavaThread "Thread-48" daemon [_thread_in_native, id=4604, stack(0x049b0000,0x04a00000)]
  0x045c4400 JavaThread "Thread-45" daemon [_thread_blocked, id=6036, stack(0x059e0000,0x05a30000)]
  0x00e18c00 JavaThread "http-apr-8282-exec-10" daemon [_thread_blocked, id=8548, stack(0x05a30000,0x05a80000)]
  0x00e18400 JavaThread "http-apr-8282-exec-9" daemon [_thread_blocked, id=11616, stack(0x05770000,0x057c0000)]
  0x00e17c00 JavaThread "http-apr-8282-exec-8" daemon [_thread_blocked, id=10540, stack(0x05950000,0x059a0000)]
  0x045c5000 JavaThread "http-apr-8282-exec-7" daemon [_thread_blocked, id=544, stack(0x05830000,0x05880000)]
  0x045c4c00 JavaThread "http-apr-8282-exec-6" daemon [_thread_blocked, id=10324, stack(0x05880000,0x058d0000)]
  0x045c4000 JavaThread "http-apr-8282-exec-5" daemon [_thread_blocked, id=9332, stack(0x05380000,0x053d0000)]
  0x045c3800 JavaThread "http-apr-8282-exec-4" daemon [_thread_blocked, id=12088, stack(0x05710000,0x05760000)]
  0x045c3400 JavaThread "http-apr-8282-exec-3" daemon [_thread_blocked, id=10236, stack(0x05530000,0x05580000)]
  0x045c2c00 JavaThread "http-apr-8282-exec-2" daemon [_thread_blocked, id=4384, stack(0x055f0000,0x05640000)]
  0x045c2800 JavaThread "http-apr-8282-exec-1" daemon [_thread_blocked, id=13636, stack(0x054e0000,0x05530000)]
  0x045c2000 JavaThread "http-apr-8282-AsyncTimeout" daemon [_thread_blocked, id=6232, stack(0x05590000,0x055e0000)]
  0x045c1800 JavaThread "http-apr-8282-Acceptor-0" daemon [_thread_in_native, id=10572, stack(0x05480000,0x054d0000)]
  0x045c1400 JavaThread "http-apr-8282-Sendfile-0" daemon [_thread_blocked, id=1680, stack(0x04cd0000,0x04d20000)]
  0x045c0c00 JavaThread "http-apr-8282-CometPoller-7" daemon [_thread_blocked, id=5196, stack(0x05410000,0x05460000)]
  0x045c0800 JavaThread "http-apr-8282-CometPoller-6" daemon [_thread_blocked, id=12100, stack(0x05330000,0x05380000)]
  0x045c0000 JavaThread "http-apr-8282-CometPoller-5" daemon [_thread_blocked, id=4244, stack(0x052a0000,0x052f0000)]
  0x045bfc00 JavaThread "http-apr-8282-CometPoller-4" daemon [_thread_blocked, id=3168, stack(0x04a70000,0x04ac0000)]
  0x045bf400 JavaThread "http-apr-8282-CometPoller-3" daemon [_thread_blocked, id=5136, stack(0x05010000,0x05060000)]
  0x045bec00 JavaThread "http-apr-8282-CometPoller-2" daemon [_thread_blocked, id=4852, stack(0x051a0000,0x051f0000)]
  0x045be800 JavaThread "http-apr-8282-CometPoller-1" daemon [_thread_blocked, id=7208, stack(0x05220000,0x05270000)]
  0x045be000 JavaThread "http-apr-8282-CometPoller-0" daemon [_thread_blocked, id=6996, stack(0x05100000,0x05150000)]
  0x045bdc00 JavaThread "http-apr-8282-Poller-7" daemon [_thread_blocked, id=12212, stack(0x00ff0000,0x01040000)]
  0x0441dc00 JavaThread "http-apr-8282-Poller-6" daemon [_thread_in_native, id=6640, stack(0x01280000,0x012d0000)]
  0x0441d800 JavaThread "http-apr-8282-Poller-5" daemon [_thread_blocked, id=4164, stack(0x05070000,0x050c0000)]
  0x0441d000 JavaThread "http-apr-8282-Poller-4" daemon [_thread_blocked, id=12240, stack(0x04fc0000,0x05010000)]
  0x0441cc00 JavaThread "http-apr-8282-Poller-3" daemon [_thread_blocked, id=10148, stack(0x04ba0000,0x04bf0000)]
  0x0441c400 JavaThread "http-apr-8282-Poller-2" daemon [_thread_blocked, id=10648, stack(0x04d20000,0x04d70000)]
  0x045afc00 JavaThread "http-apr-8282-Poller-1" daemon [_thread_blocked, id=2852, stack(0x04c60000,0x04cb0000)]
  0x0441a800 JavaThread "http-apr-8282-Poller-0" daemon [_thread_in_native, id=9412, stack(0x047c0000,0x04810000)]
  0x043a3800 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=7992, stack(0x04940000,0x04990000)]
  0x04452c00 JavaThread "GC Daemon" daemon [_thread_blocked, id=9732, stack(0x04810000,0x04860000)]
  0x00e0c800 JavaThread "Service Thread" daemon [_thread_blocked, id=5408, stack(0x010b0000,0x01100000)]
  0x00e07400 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=1508, stack(0x03fc0000,0x04010000)]
  0x00e02400 JavaThread "Attach Listener" daemon [_thread_blocked, id=13124, stack(0x01140000,0x01190000)]
  0x00dff000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=12428, stack(0x00e40000,0x00e90000)]
  0x00dec000 JavaThread "Finalizer" daemon [_thread_blocked, id=13996, stack(0x012e0000,0x01330000)]
  0x00de7400 JavaThread "Reference Handler" daemon [_thread_blocked, id=10820, stack(0x01220000,0x01270000)]
  0x0110cc00 JavaThread "main" [_thread_in_native, id=7536, stack(0x003a0000,0x003f0000)]

Other Threads:
  0x00de5800 VMThread [stack: 0x01060000,0x010b0000] [id=13228]
  0x00e28400 WatcherThread [stack: 0x01190000,0x011e0000] [id=8396]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 6912K, used 2283K [0x23ca0000, 0x24420000, 0x291f0000)
  eden space 6144K,  36% used [0x23ca0000, 0x23ecc168, 0x242a0000)
  from space 768K,   7% used [0x242a0000, 0x242aeb40, 0x24360000)
  to   space 768K,   0% used [0x24360000, 0x24360000, 0x24420000)
 tenured generation   total 15288K, used 9172K [0x291f0000, 0x2a0de000, 0x33ca0000)
   the space 15288K,  59% used [0x291f0000, 0x29ae5238, 0x29ae5400, 0x2a0de000)
 compacting perm gen  total 12288K, used 6885K [0x33ca0000, 0x348a0000, 0x37ca0000)
   the space 12288K,  56% used [0x33ca0000, 0x343596f0, 0x34359800, 0x348a0000)
    ro space 10240K,  45% used [0x37ca0000, 0x38123958, 0x38123a00, 0x386a0000)
    rw space 12288K,  54% used [0x386a0000, 0x38d27498, 0x38d27600, 0x392a0000)

Code Cache  [0x01fa0000, 0x02190000, 0x03fa0000)
 total_blobs=1011 nmethods=834 adapters=111 free_code_cache=30808Kb largest_free_block=31547008

Compilation events (10 events):
Event: 106.578 Thread 0x00e07400 nmethod 838 0x02187388 code [0x02187480, 0x02187550]
Event: 142.439 Thread 0x00e07400  840             org.apache.catalina.valves.ValveBase::getNext (5 bytes)
Event: 142.439 Thread 0x00e07400 nmethod 840 0x021878c8 code [0x021879c0, 0x02187a40]
Event: 160.714 Thread 0x00e07400  841             java.lang.ref.Reference::access$100 (4 bytes)
Event: 160.714 Thread 0x00e07400 nmethod 841 0x02187a88 code [0x02187b80, 0x02187bf0]
Event: 172.447 Thread 0x00e07400  842             java.util.regex.Pattern$Start::match (90 bytes)
Event: 172.447 Thread 0x00e07400 nmethod 842 0x02187c48 code [0x02187d60, 0x02187edc]
Event: 182.450 Thread 0x00e07400  843             java.util.regex.Pattern$Single::isSatisfiedBy (14 bytes)
Event: 182.450 Thread 0x00e07400 nmethod 843 0x02188048 code [0x02188140, 0x021881d0]
Event: 208.430 Thread 0x00e07400  844   !         org.apache.catalina.valves.AccessLogValve$DateFormatCache$Cache::getFormatInternal (514 bytes)

GC Heap History (10 events):
Event: 134.915 GC heap before
{Heap before GC invocations=23 (full 1):
 def new generation   total 4992K, used 4615K [0x23ca0000, 0x24200000, 0x291f0000)
  eden space 4480K,  99% used [0x23ca0000, 0x240fe310, 0x24100000)
  from space 512K,  27% used [0x24180000, 0x241a3b58, 0x24200000)
  to   space 512K,   0% used [0x24100000, 0x24100000, 0x24180000)
 tenured generation   total 10944K, used 10926K [0x291f0000, 0x29ca0000, 0x33ca0000)
   the space 10944K,  99% used [0x291f0000, 0x29c9b900, 0x29c9ba00, 0x29ca0000)
 compacting perm gen  total 12288K, used 6885K [0x33ca0000, 0x348a0000, 0x37ca0000)
   the space 12288K,  56% used [0x33ca0000, 0x343596f0, 0x34359800, 0x348a0000)
    ro space 10240K,  45% used [0x37ca0000, 0x38123958, 0x38123a00, 0x386a0000)
    rw space 12288K,  54% used [0x386a0000, 0x38d27498, 0x38d27600, 0x392a0000)
Event: 134.918 GC heap after
Heap after GC invocations=24 (full 1):
 def new generation   total 4992K, used 142K [0x23ca0000, 0x24200000, 0x291f0000)
  eden space 4480K,   0% used [0x23ca0000, 0x23ca0000, 0x24100000)
  from space 512K,  27% used [0x24100000, 0x24123ac8, 0x24180000)
  to   space 512K,   0% used [0x24180000, 0x24180000, 0x24200000)
 tenured generation   total 10944K, used 10926K [0x291f0000, 0x29ca0000, 0x33ca0000)
   the space 10944K,  99% used [0x291f0000, 0x29c9b900, 0x29c9ba00, 0x29ca0000)
 compacting perm gen  total 12288K, used 6885K [0x33ca0000, 0x348a0000, 0x37ca0000)
   the space 12288K,  56% used [0x33ca0000, 0x343596f0, 0x34359800, 0x348a0000)
    ro space 10240K,  45% used [0x37ca0000, 0x38123958, 0x38123a00, 0x386a0000)
    rw space 12288K,  54% used [0x386a0000, 0x38d27498, 0x38d27600, 0x392a0000)
}
Event: 148.951 GC heap before
{Heap before GC invocations=24 (full 1):
 def new generation   total 4992K, used 4622K [0x23ca0000, 0x24200000, 0x291f0000)
  eden space 4480K, 100% used [0x23ca0000, 0x24100000, 0x24100000)
  from space 512K,  27% used [0x24100000, 0x24123ac8, 0x24180000)
  to   space 512K,   0% used [0x24180000, 0x24180000, 0x24200000)
 tenured generation   total 10944K, used 10926K [0x291f0000, 0x29ca0000, 0x33ca0000)
   the space 10944K,  99% used [0x291f0000, 0x29c9b900, 0x29c9ba00, 0x29ca0000)
 compacting perm gen  total 12288K, used 6885K [0x33ca0000, 0x348a0000, 0x37ca0000)
   the space 12288K,  56% used [0x33ca0000, 0x343596f0, 0x34359800, 0x348a0000)
    ro space 10240K,  45% used [0x37ca0000, 0x38123958, 0x38123a00, 0x386a0000)
    rw space 12288K,  54% used [0x386a0000, 0x38d27498, 0x38d27600, 0x392a0000)
Event: 148.954 GC heap after
Heap after GC invocations=25 (full 1):
 def new generation   total 4992K, used 142K [0x23ca0000, 0x24200000, 0x291f0000)
  eden space 4480K,   0% used [0x23ca0000, 0x23ca0000, 0x24100000)
  from space 512K,  27% used [0x24180000, 0x241a3ac8, 0x24200000)
  to   space 512K,   0% used [0x24100000, 0x24100000, 0x24180000)
 tenured generation   total 10944K, used 10926K [0x291f0000, 0x29ca0000, 0x33ca0000)
   the space 10944K,  99% used [0x291f0000, 0x29c9b900, 0x29c9ba00, 0x29ca0000)
 compacting perm gen  total 12288K, used 6885K [0x33ca0000, 0x348a0000, 0x37ca0000)
   the space 12288K,  56% used [0x33ca0000, 0x343596f0, 0x34359800, 0x348a0000)
    ro space 10240K,  45% used [0x37ca0000, 0x38123958, 0x38123a00, 0x386a0000)
    rw space 12288K,  54% used [0x386a0000, 0x38d27498, 0x38d27600, 0x392a0000)
}
Event: 160.626 GC heap before
{Heap before GC invocations=25 (full 1):
 def new generation   total 4992K, used 4621K [0x23ca0000, 0x24200000, 0x291f0000)
  eden space 4480K,  99% used [0x23ca0000, 0x240ffbb8, 0x24100000)
  from space 512K,  27% used [0x24180000, 0x241a3ac8, 0x24200000)
  to   space 512K,   0% used [0x24100000, 0x24100000, 0x24180000)
 tenured generation   total 10944K, used 10926K [0x291f0000, 0x29ca0000, 0x33ca0000)
   the space 10944K,  99% used [0x291f0000, 0x29c9b900, 0x29c9ba00, 0x29ca0000)
 compacting perm gen  total 12288K, used 6885K [0x33ca0000, 0x348a0000, 0x37ca0000)
   the space 12288K,  56% used [0x33ca0000, 0x343596f0, 0x34359800, 0x348a0000)
    ro space 10240K,  45% used [0x37ca0000, 0x38123958, 0x38123a00, 0x386a0000)
    rw space 12288K,  54% used [0x386a0000, 0x38d27498, 0x38d27600, 0x392a0000)
Event: 160.710 GC heap after
Heap after GC invocations=26 (full 2):
 def new generation   total 6912K, used 0K [0x23ca0000, 0x24420000, 0x291f0000)
  eden space 6144K,   0% used [0x23ca0000, 0x23ca0000, 0x242a0000)
  from space 768K,   0% used [0x242a0000, 0x242a0000, 0x24360000)
  to   space 768K,   0% used [0x24360000, 0x24360000, 0x24420000)
 tenured generation   total 15288K, used 9172K [0x291f0000, 0x2a0de000, 0x33ca0000)
   the space 15288K,  59% used [0x291f0000, 0x29ae5238, 0x29ae5400, 0x2a0de000)
 compacting perm gen  total 12288K, used 6885K [0x33ca0000, 0x348a0000, 0x37ca0000)
   the space 12288K,  56% used [0x33ca0000, 0x343596f0, 0x34359800, 0x348a0000)
    ro space 10240K,  45% used [0x37ca0000, 0x38123958, 0x38123a00, 0x386a0000)
    rw space 12288K,  54% used [0x386a0000, 0x38d27498, 0x38d27600, 0x392a0000)
}
Event: 176.658 GC heap before
{Heap before GC invocations=26 (full 2):
 def new generation   total 6912K, used 6136K [0x23ca0000, 0x24420000, 0x291f0000)
  eden space 6144K,  99% used [0x23ca0000, 0x2429e270, 0x242a0000)
  from space 768K,   0% used [0x242a0000, 0x242a0000, 0x24360000)
  to   space 768K,   0% used [0x24360000, 0x24360000, 0x24420000)
 tenured generation   total 15288K, used 9172K [0x291f0000, 0x2a0de000, 0x33ca0000)
   the space 15288K,  59% used [0x291f0000, 0x29ae5238, 0x29ae5400, 0x2a0de000)
 compacting perm gen  total 12288K, used 6885K [0x33ca0000, 0x348a0000, 0x37ca0000)
   the space 12288K,  56% used [0x33ca0000, 0x343596f0, 0x34359800, 0x348a0000)
    ro space 10240K,  45% used [0x37ca0000, 0x38123958, 0x38123a00, 0x386a0000)
    rw space 12288K,  54% used [0x386a0000, 0x38d27498, 0x38d27600, 0x392a0000)
Event: 176.660 GC heap after
Heap after GC invocations=27 (full 2):
 def new generation   total 6912K, used 58K [0x23ca0000, 0x24420000, 0x291f0000)
  eden space 6144K,   0% used [0x23ca0000, 0x23ca0000, 0x242a0000)
  from space 768K,   7% used [0x24360000, 0x2436e8e0, 0x24420000)
  to   space 768K,   0% used [0x242a0000, 0x242a0000, 0x24360000)
 tenured generation   total 15288K, used 9172K [0x291f0000, 0x2a0de000, 0x33ca0000)
   the space 15288K,  59% used [0x291f0000, 0x29ae5238, 0x29ae5400, 0x2a0de000)
 compacting perm gen  total 12288K, used 6885K [0x33ca0000, 0x348a0000, 0x37ca0000)
   the space 12288K,  56% used [0x33ca0000, 0x343596f0, 0x34359800, 0x348a0000)
    ro space 10240K,  45% used [0x37ca0000, 0x38123958, 0x38123a00, 0x386a0000)
    rw space 12288K,  54% used [0x386a0000, 0x38d27498, 0x38d27600, 0x392a0000)
}
Event: 197.516 GC heap before
{Heap before GC invocations=27 (full 2):
 def new generation   total 6912K, used 6198K [0x23ca0000, 0x24420000, 0x291f0000)
  eden space 6144K,  99% used [0x23ca0000, 0x2429f158, 0x242a0000)
  from space 768K,   7% used [0x24360000, 0x2436e8e0, 0x24420000)
  to   space 768K,   0% used [0x242a0000, 0x242a0000, 0x24360000)
 tenured generation   total 15288K, used 9172K [0x291f0000, 0x2a0de000, 0x33ca0000)
   the space 15288K,  59% used [0x291f0000, 0x29ae5238, 0x29ae5400, 0x2a0de000)
 compacting perm gen  total 12288K, used 6885K [0x33ca0000, 0x348a0000, 0x37ca0000)
   the space 12288K,  56% used [0x33ca0000, 0x343596f0, 0x34359800, 0x348a0000)
    ro space 10240K,  45% used [0x37ca0000, 0x38123958, 0x38123a00, 0x386a0000)
    rw space 12288K,  54% used [0x386a0000, 0x38d27498, 0x38d27600, 0x392a0000)
Event: 197.517 GC heap after
Heap after GC invocations=28 (full 2):
 def new generation   total 6912K, used 58K [0x23ca0000, 0x24420000, 0x291f0000)
  eden space 6144K,   0% used [0x23ca0000, 0x23ca0000, 0x242a0000)
  from space 768K,   7% used [0x242a0000, 0x242aeb40, 0x24360000)
  to   space 768K,   0% used [0x24360000, 0x24360000, 0x24420000)
 tenured generation   total 15288K, used 9172K [0x291f0000, 0x2a0de000, 0x33ca0000)
   the space 15288K,  59% used [0x291f0000, 0x29ae5238, 0x29ae5400, 0x2a0de000)
 compacting perm gen  total 12288K, used 6885K [0x33ca0000, 0x348a0000, 0x37ca0000)
   the space 12288K,  56% used [0x33ca0000, 0x343596f0, 0x34359800, 0x348a0000)
    ro space 10240K,  45% used [0x37ca0000, 0x38123958, 0x38123a00, 0x386a0000)
    rw space 12288K,  54% used [0x386a0000, 0x38d27498, 0x38d27600, 0x392a0000)
}

Deoptimization events (0 events):
No events

Internal exceptions (10 events):
Event: 4.428 Thread 0x045c4000 Threw 0x23cef500 at C:\jdk7u2_32P\jdk7u4\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 4.429 Thread 0x045c4000 Threw 0x23cefbc0 at C:\jdk7u2_32P\jdk7u4\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 5.475 Thread 0x045c4000 Threw 0x23cf6230 at C:\jdk7u2_32P\jdk7u4\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 5.475 Thread 0x045c4000 Threw 0x23cf6770 at C:\jdk7u2_32P\jdk7u4\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 7.594 Thread 0x045c3400 Threw 0x23de2078 at C:\jdk7u2_32P\jdk7u4\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 7.594 Thread 0x045c3400 Threw 0x23de27a8 at C:\jdk7u2_32P\jdk7u4\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 7.597 Thread 0x045c3400 Threw 0x23dfc028 at C:\jdk7u2_32P\jdk7u4\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 7.597 Thread 0x045c3400 Threw 0x23dfc758 at C:\jdk7u2_32P\jdk7u4\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 11.306 Thread 0x045c4000 Threw 0x23fece50 at C:\jdk7u2_32P\jdk7u4\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 11.306 Thread 0x045c4000 Threw 0x23fed548 at C:\jdk7u2_32P\jdk7u4\hotspot\src\share\vm\prims\jvm.cpp:1166

Events (10 events):
Event: 160.715 Executing VM operation: RevokeBias done
Event: 160.715 Executing VM operation: RevokeBias
Event: 160.715 Executing VM operation: RevokeBias done
Event: 160.715 Executing VM operation: BulkRevokeBias
Event: 160.715 Executing VM operation: BulkRevokeBias done
Event: 163.534 Thread 0x00e19000 Thread added: 0x00e19000
Event: 176.658 Executing VM operation: GenCollectForAllocation
Event: 176.661 Executing VM operation: GenCollectForAllocation done
Event: 197.515 Executing VM operation: GenCollectForAllocation
Event: 197.517 Executing VM operation: GenCollectForAllocation done


Dynamic libraries:
0x01370000 - 0x0139f000 	C:\Program Files\Java\jdk1.7.0_04\bin\java.exe
0x779b0000 - 0x77ad8000 	C:\Windows\system32\ntdll.dll
0x76930000 - 0x76a0c000 	C:\Windows\system32\kernel32.dll
0x76a10000 - 0x76ad6000 	C:\Windows\system32\ADVAPI32.dll
0x76ae0000 - 0x76ba3000 	C:\Windows\system32\RPCRT4.dll
0x76430000 - 0x764cd000 	C:\Windows\system32\USER32.dll
0x763e0000 - 0x7642b000 	C:\Windows\system32\GDI32.dll
0x74c40000 - 0x74dde000 	C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.6002.18305_none_5cb72f2a088b0ed3\COMCTL32.dll
0x76820000 - 0x768ca000 	C:\Windows\system32\msvcrt.dll
0x768d0000 - 0x76929000 	C:\Windows\system32\SHLWAPI.dll
0x76730000 - 0x7674e000 	C:\Windows\system32\IMM32.DLL
0x764d0000 - 0x76598000 	C:\Windows\system32\MSCTF.dll
0x76e80000 - 0x76e89000 	C:\Windows\system32\LPK.DLL
0x76e00000 - 0x76e7d000 	C:\Windows\system32\USP10.dll
0x66720000 - 0x667de000 	C:\Program Files\Java\jdk1.7.0_04\jre\bin\msvcr100.dll
0x62060000 - 0x623aa000 	C:\Program Files\Java\jdk1.7.0_04\jre\bin\client\jvm.dll
0x737b0000 - 0x737b7000 	C:\Windows\system32\WSOCK32.dll
0x763b0000 - 0x763dd000 	C:\Windows\system32\WS2_32.dll
0x76750000 - 0x76756000 	C:\Windows\system32\NSI.dll
0x748a0000 - 0x748d2000 	C:\Windows\system32\WINMM.dll
0x76070000 - 0x761b5000 	C:\Windows\system32\ole32.dll
0x76d70000 - 0x76dfd000 	C:\Windows\system32\OLEAUT32.dll
0x74860000 - 0x7489e000 	C:\Windows\system32\OLEACC.dll
0x76060000 - 0x76067000 	C:\Windows\system32\PSAPI.DLL
0x6c1c0000 - 0x6c1cc000 	C:\Program Files\Java\jdk1.7.0_04\jre\bin\verify.dll
0x6adc0000 - 0x6ade0000 	C:\Program Files\Java\jdk1.7.0_04\jre\bin\java.dll
0x6a640000 - 0x6a653000 	C:\Program Files\Java\jdk1.7.0_04\jre\bin\zip.dll
0x6bed0000 - 0x6bee4000 	C:\Program Files\Java\jdk1.7.0_04\jre\bin\net.dll
0x756f0000 - 0x7572b000 	C:\Windows\system32\mswsock.dll
0x757c0000 - 0x757c5000 	C:\Windows\System32\wship6.dll
0x6c070000 - 0x6c07f000 	C:\Program Files\Java\jdk1.7.0_04\jre\bin\nio.dll
0x6c000000 - 0x6c00a000 	C:\Program Files\Java\jdk1.7.0_04\jre\bin\management.dll
0x10000000 - 0x10107000 	C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27\bin\tcnative-1.dll
0x753f0000 - 0x7542b000 	C:\Windows\system32\rsaenh.dll
0x68c00000 - 0x68c20000 	C:\Program Files\Java\jdk1.7.0_04\jre\bin\sunec.dll
0x6adb0000 - 0x6adb9000 	C:\Program Files\Java\jdk1.7.0_04\jre\bin\sunmscapi.dll
0x75970000 - 0x75a62000 	C:\Windows\system32\CRYPT32.dll
0x75ad0000 - 0x75ae2000 	C:\Windows\system32\MSASN1.dll
0x75f20000 - 0x75f3e000 	C:\Windows\system32\USERENV.dll
0x75f00000 - 0x75f14000 	C:\Windows\system32\Secur32.dll
0x75340000 - 0x75345000 	C:\Windows\System32\wshtcpip.dll
0x75330000 - 0x7533f000 	C:\Windows\system32\NLAapi.dll
0x758d0000 - 0x758e9000 	C:\Windows\system32\IPHLPAPI.DLL
0x75890000 - 0x758c5000 	C:\Windows\system32\dhcpcsvc.DLL
0x75b20000 - 0x75b4c000 	C:\Windows\system32\DNSAPI.dll
0x75880000 - 0x75887000 	C:\Windows\system32\WINNSI.DLL
0x75850000 - 0x75872000 	C:\Windows\system32\dhcpcsvc6.DLL
0x733d0000 - 0x733df000 	C:\Windows\system32\napinsp.dll
0x733c0000 - 0x733c8000 	C:\Windows\System32\winrnr.dll
0x761c0000 - 0x76209000 	C:\Windows\system32\WLDAP32.dll
0x735d0000 - 0x735d6000 	C:\Windows\system32\rasadhlp.dll
0x74210000 - 0x742ec000 	C:\Windows\system32\DBGHELP.DLL

VM Arguments:
jvm_args: -Djava.util.logging.config.file=C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27\conf\logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27\endorsed -Dcatalina.base=C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27 -Dcatalina.home=C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27 -Djava.io.tmpdir=C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27\temp 
java_command: org.apache.catalina.startup.Bootstrap start
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_04
JRE_HOME=C:\Program Files\Java\jdk1.7.0_04
CLASSPATH=C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27\bin\bootstrap.jar;C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27\bin\tomcat-juli.jar
PATH=D:\Program Files\Parallels\Plesk\Mail Servers\Mail Enable\BIN;D:\PROGRA~1\PARALL~1\Plesk\ADDITI~1\Perl\site\bin;D:\PROGRA~1\PARALL~1\Plesk\ADDITI~1\Perl\bin;D:\Program Files\Parallels\Plesk\Additional\Python\Scripts;D:\Program Files\Parallels\Plesk\Additional\Python\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;E:\Program Files\Microsoft SQL Server\110\Tools\Binn\;E:\Program Files\Microsoft SQL Server\110\DTS\Binn\;E:\Program Files\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\
USERNAME=AdminKP
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 13, GenuineIntel



---------------  S Y S T E M  ---------------

OS: Windows Server 2008 Build 6002 Service Pack 2

CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 13, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, tsc

Memory: 4k page, physical 4159888k(1605684k free), swap 10347160k(8198712k free)

vm_info: Java HotSpot(TM) Client VM (23.0-b21) for windows-x86 JRE (1.7.0_04-b20), built on Apr 12 2012 03:26:46 by "java_re" with unknown MS VC++:1600

time: Fri Apr 27 18:33:55 2012
elapsed time: 211 seconds



Regards,
Konstantin Preißer


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


Re: Websocket Questions

Posted by Mark Thomas <ma...@apache.org>.
On 27/04/2012 15:51, Konstantin Preißer wrote:
> Hi all,
> 
> I'm using Tomcat 7.0.27 with Native 1.1.23 on Windows Server 2008
> 32-bit with Java 1.7.0_03.
> 
> Recently I started a project which uses Websockets. It is a simple
> app where the clients submit the current mouse position to the
> server, and the server then broadcasts the position of that user to
> all other connected users.
> 
> To see how the Websocket Implementation in Tomcat works, I read the
> Chat example
> (http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_27/webapps/examples/WEB-INF/classes/websocket/chat/ChatWebSocketServlet.java)
> from Johno Crawford.
> 
> 1. It seems that the connector's "connectionTimeout" attribute is
> used to determine when the Websocket connection should be closed
> after inactivity. Is this intended?

At the moment, yes. There is probably a need for a separate timeout but
there needs to be a timeout. You can use ping messages to avoid it.

> 2. Is there experience of using the HTTP APR connector with
> Websockets? When I tried to use Websockets with that connector, the
> JVM crashed in tcnative-1.dll some minutes after Tomcat was started:

It has been tested as much as the others.

> # # A fatal error has been detected by the Java Runtime Environment: 
> # #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x1000476d,
> pid=3144, tid=9820 # # JRE version: 7.0_03-b05 # Java VM: Java
> HotSpot(TM) Client VM (22.1-b02 mixed mode, sharing windows-x86 ) #
> Problematic frame: # C  [tcnative-1.dll+0x476d] # # Core dump
> written. Default location:
> C:\Users\AdminKP\Desktop\apache-tomcat-7.0.27\bin\hs_err_pid3144.mdmp

The full stack would be useful. It might point to where things are going
wrong.

Mark

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