WOHTTPConnection sendRequest(WORequest request) creates a new thread to implement timeout. I was creating threads also because the sendRequest implementation of timeout wasn't working for me. I disabled my code that created threads but was still getting the OutOfMemory problem.
Start of the thread dump below. I was able to reproduce the problem by manually clicking on the refresh page button over and over again.
jstack 9451
2010-12-01 16:52:02
Full thread dump Java HotSpot(TM) 64-Bit Server VM (16.3-b01 mixed mode):
"Attach Listener" daemon prio=10 tid=0x0000000057371800 nid=0x4485 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Thread-1129" prio=10 tid=0x0000000057093800 nid=0x2cde in Object.wait() [0x000000005bb4a000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aaab07d17a8> (a [Z)
at java.lang.Object.wait(Object.java:485)
at com.webobjects.appserver._private.WOUrlConnection$UrlDataReader.run(WOUrlConnection.java:452)
- locked <0x00002aaab07d17a8> (a [Z)
at java.lang.Thread.run(Thread.java:619)
"Thread-1126" prio=10 tid=0x00000000564f8000 nid=0x2cdb in Object.wait() [0x000000005ba49000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aaab0784fc8> (a [Z)
at java.lang.Object.wait(Object.java:485)
at com.webobjects.appserver._private.WOUrlConnection$UrlDataReader.run(WOUrlConnection.java:452)
- locked <0x00002aaab0784fc8> (a [Z)
at java.lang.Thread.run(Thread.java:619)
"Thread-1123" prio=10 tid=0x00000000564af000 nid=0x2cd8 in Object.wait() [0x000000005b948000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aaab073c040> (a [Z)
at java.lang.Object.wait(Object.java:485)
at com.webobjects.appserver._private.WOUrlConnection$UrlDataReader.run(WOUrlConnection.java:452)
- locked <0x00002aaab073c040> (a [Z)
at java.lang.Thread.run(Thread.java:619)
"Thread-1120" prio=10 tid=0x00000000563e0800 nid=0x2cd5 in Object.wait() [0x000000005b847000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aaab06f18f0> (a [Z)
at java.lang.Object.wait(Object.java:485)
at com.webobjects.appserver._private.WOUrlConnection$UrlDataReader.run(WOUrlConnection.java:452)
- locked <0x00002aaab06f18f0> (a [Z)
at java.lang.Thread.run(Thread.java:619)
"Thread-1117" prio=10 tid=0x000000005695c000 nid=0x2cd2 in Object.wait() [0x000000005b746000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aaab06a5360> (a [Z)
at java.lang.Object.wait(Object.java:485)
at com.webobjects.appserver._private.WOUrlConnection$UrlDataReader.run(WOUrlConnection.java:452)
- locked <0x00002aaab06a5360> (a [Z)
at java.lang.Thread.run(Thread.java:619)
"Thread-1114" prio=10 tid=0x00000000566de800 nid=0x2cc0 in Object.wait() [0x000000005b645000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aaab0659af8> (a [Z)
at java.lang.Object.wait(Object.java:485)
at com.webobjects.appserver._private.WOUrlConnection$UrlDataReader.run(WOUrlConnection.java:452)
- locked <0x00002aaab0659af8> (a [Z)
at java.lang.Thread.run(Thread.java:619)
"Thread-1111" prio=10 tid=0x0000000057098800 nid=0x2cbd in Object.wait() [0x000000005b544000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aaab060e6a0> (a [Z)
at java.lang.Object.wait(Object.java:485)
at com.webobjects.appserver._private.WOUrlConnection$UrlDataReader.run(WOUrlConnection.java:452)
- locked <0x00002aaab060e6a0> (a [Z)
at java.lang.Thread.run(Thread.java:619)
"Thread-1108" prio=10 tid=0x0000000057097800 nid=0x2cba in Object.wait() [0x000000005b443000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aaab05c45f8> (a [Z)
at java.lang.Object.wait(Object.java:485)
at com.webobjects.appserver._private.WOUrlConnection$UrlDataReader.run(WOUrlConnection.java:452)
- locked <0x00002aaab05c45f8> (a [Z)
at java.lang.Thread.run(Thread.java:619)
"Thread-1105" prio=10 tid=0x0000000057330000 nid=0x2cb7 in Object.wait() [0x000000005b342000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aaab057f298> (a [Z)
at java.lang.Object.wait(Object.java:485)
at com.webobjects.appserver._private.WOUrlConnection$UrlDataReader.run(WOUrlConnection.java:452)
- locked <0x00002aaab057f298> (a [Z)
at java.lang.Thread.run(Thread.java:619)
"Thread-1102" prio=10 tid=0x00000000564b5800 nid=0x2cb4 in Object.wait() [0x000000005b241000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aaab0535cc8> (a [Z)
at java.lang.Object.wait(Object.java:485)
at com.webobjects.appserver._private.WOUrlConnection$UrlDataReader.run(WOUrlConnection.java:452)
- locked <0x00002aaab0535cc8> (a [Z)
at java.lang.Thread.run(Thread.java:619)
"Thread-1099" prio=10 tid=0x00000000564ee000 nid=0x2cb1 in Object.wait() [0x000000005b140000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aaab04e9d98> (a [Z)
at java.lang.Object.wait(Object.java:485)
at com.webobjects.appserver._private.WOUrlConnection$UrlDataReader.run(WOUrlConnection.java:452)
- locked <0x00002aaab04e9d98> (a [Z)
at java.lang.Thread.run(Thread.java:619)
"Thread-1096" prio=10 tid=0x000000005699a800 nid=0x2cae in Object.wait() [0x000000005b03f000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00002aaab049ea28> (a [Z)
at java.lang.Object.wait(Object.java:485)
at com.webobjects.appserver._private.WOUrlConnection$UrlDataReader.run(WOUrlConnection.java:452)
- locked <0x00002aaab049ea28> (a [Z)
at java.lang.Thread.run(Thread.java:619)