Issue Details (XML | Word | Printable)

Key: DIRMINA-206
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: peter royal
Reporter: Trustin Lee
Votes: 2
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
MINA

Prevent OutOfMemoryError when a server or a client is overloaded

Created: 12/Apr/06 05:22 PM   Updated: 26/Sep/06 05:06 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 1.0.0

Time Tracking:
Not Specified

Resolution Date: 26/Sep/06 05:06 AM


 Description  « Hide
MINA doesn't throttle read or write traffic even if a client or a server suffers from bottleneck. It will eventually cause the event buffer become full can throw an OutOfMemoryError. We need to prevent it.

Here's the related thread in our mailing list:

http://mail-archives.apache.org/mod_mbox/directory-mina-dev/200604.mbox/%3c44325244.2020109@falcom.de%3e

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
peter royal added a comment - 27/Jun/06 12:25 AM
summarizing list thread:

 * configure size of read buffer and automatically disable reads once the buffer is full
 * buffer would be a filter that is inserted *before* the ThreadPoolFilter
 * this eliminates the complexities of tracking things in greater detail and all the goop from the thread pool
 * writes still tbd, one thought is to block the write, but that has implications if no thread pool filter is in use

peter royal added a comment - 27/Jun/06 11:33 PM
I created a filter to throttle reads. The default per-connection 1mb buffer may/probably is too large.. suggestions welcome.

The filter wraps the ThreadPoolFilter (just adds itself before + after)

Trustin Lee added a comment - 13/Sep/06 01:53 AM
I think 1 mega bytes are a little bit more than much. Probably we could set it to about the default socket read buffer size in Linux. Perhaps with an extra room like 50%? WDYT?

Trustin Lee added a comment - 26/Sep/06 04:58 AM
We still need to take care of write overflow and more convenient way to prevent OutOfMemoryError, but Peter's patch at least solves the situation when the server is overloaded. I'd like to mark this issue as resolved and provide another issue for the remaining problems.

Trustin Lee added a comment - 26/Sep/06 05:06 AM
It is resolved not in 1.0.1 but in 1.0 by Peter Royal.