[2608] in java-interest

home help back first fref pref prev next nref lref last post

Re: Bug in Socket.accept()/close() ?

daemon@ATHENA.MIT.EDU (Bob Beck)
Thu Oct 5 23:02:01 1995

Date: Thu, 5 Oct 95 18:05 PDT
To: java-interest@java.sun.com
From: Bob Beck <rbk@ibeam.jf.intel.com>
Cc: Arthur.Vanhoff@Eng.Sun.COM, pavani@scndprsn.eng.sun.com

More on this - I did a version of NetworkClient that caches threads and this
works indefinitely.  This suggests the handle accumulation problem you have
is likely due to the VM not releasing the thread handle for a created
thread.  In Win32, you must closeHandle() on the thread handle for it to be
able to go away.

Could this be what the problem is?

- Bob

At 10:42 AM 10/2/95 PDT, Bob Beck wrote:
>I think I've found a bug in Socket.accept() and close().  I have a simple
>client and server application (in Alpha3, based on net.NetworkClient and
>net.NetworkServer) where the server is a minor extension over
>serviceRequest(), and the client is in a loop attempting to create a
>connection then shut it down.  On my NT3.51 system, after about 12000
>connections are created on the server, the server process fails with an out
>of memory exception and can't be recovered (other than killing the server
>process and restarting it).
>
>After some digging, it looks like the server process is constantly
>accumulating OS handles.  I have verified the code is calling close() on the
>per connection socket, and that the threads are terminating (I have a
>different version of the server based on my own variant of NetworkServer
>that reuses threads and handles more exceptions, and it fails in this one
also).
>
>To see it accumulating handles, use perfmon, look at the "Handle Count"
>counter in the "process" object for each of the java processes (the one
>running DumbClient and the one running DumbServer).  The client process has
>a (roughly) constant number of handles, the server process handle count
>climbs until it gets the error.  This suggests that the Java VM isn't
>closing enough handles in the NT implementation.  I haven't tried this on a
>SUN implementation.
--
Bob Beck                rbk@ibeam.intel.com     CompuServe: 71674,106
Intel Corporation       (503)264-8856           AOL: RDBeck

-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post