Re: java.net.SocketException: Insufficient buffer space
From: John C. Bollinger (jobollin_at_indiana.edu)
Date: 11/04/04
- Next message: Mickey Segal: "Re: How do you report a JIT crash bug?"
- Previous message: Micha: "Java 1.4.2_06 installation - Whats with all the java.exe"
- In reply to: John C. Bollinger: "Re: java.net.SocketException: Insufficient buffer space"
- Next in thread: Jeff: "Re: java.net.SocketException: Insufficient buffer space"
- Reply: Jeff: "Re: java.net.SocketException: Insufficient buffer space"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 04 Nov 2004 13:03:22 -0500
I wrote:
> wasting memory. Unless you can determine the message size before
> allocating the buffer, you have an unavoidable space / speed tradeoff
> going on here.
Which is true as far as it goes, but upon further reflection I realize
that if the typical message is considerably smaller than the largest
possible message, and if there are a lot of messages, then the time to
allocate (and later GC) a large amount of unused buffer space many times
may trump the time it takes to copy bytes around in a scheme that uses a
smaller buffer by default and expands it as necessary for large
messages. Such an adaptation scheme could be incorporated into my
example code, but I'll spare you the details.
This all comes back around to the point that you need to _test_ to
determine where your performance problems are, and you need to _test_ to
determine whether any hand optimization you come up with actually
improves performance.
John Bollinger
jobollin@indiana.edu
- Next message: Mickey Segal: "Re: How do you report a JIT crash bug?"
- Previous message: Micha: "Java 1.4.2_06 installation - Whats with all the java.exe"
- In reply to: John C. Bollinger: "Re: java.net.SocketException: Insufficient buffer space"
- Next in thread: Jeff: "Re: java.net.SocketException: Insufficient buffer space"
- Reply: Jeff: "Re: java.net.SocketException: Insufficient buffer space"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|