337f5bbb8e
Now that we are going to use buffer pooling by default, it is obvious that a user will forget to call .free() and report memory leak. In this case, we should have a tool to determine if it is a bug in our allocator implementation or in the user's code. This pull request adds a system property flag called 'io.netty.resourceLeakDetection'. If set, when a user forgets to call .free(), the ResourceLeakDetector will detect it and log a message with detailed stack trace to tell where the leaked buffer has been allocated. Because obtaining stack trace is an expensive operation, I used sampling technique. Allocation is recorded only for every 113th allocation. I chose 113 because it's a prime number. In production, a user might not want to enable this option due to potential performance impact. If a user does not specify the '-Dio.netty.resourceLeakDetection' option leak detection is disabled. Even if the leak detection is enabled, the overhead should be less than 5% because only ~1% of allocations are monitored. I also replaced SharedResourceMisuseDetector with ResourceLeakDetector. |
||
---|---|---|
all | ||
buffer | ||
codec | ||
codec-http | ||
codec-socks | ||
common | ||
example | ||
handler | ||
license | ||
metrics-yammer | ||
microbench | ||
tarball | ||
testsuite | ||
transport | ||
transport-rxtx | ||
transport-sctp | ||
transport-udt | ||
.fbfilter.xml | ||
.fbprefs | ||
.gitignore | ||
LICENSE.txt | ||
NOTICE.txt | ||
pom.xml | ||
README.md |
The Netty Project
Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.
Links
-
Web Site: http://netty.io/
-
Docs: http://netty.io/docs/
-
Blog: http://netty.io/blog/
-
Twitter: @netty_project
Getting Netty
-
Download Page: http://netty.io/downloads/
-
Maven Repository:
<dependencies>
...
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
<version>X.Y.Z.Q</version>
<scope>compile</scope>
</dependency>
...
</dependencies>
Developer Information
-
Netty is setup to build using Maven
-
You need JDK 7 to build Netty. Netty will run with JDK 5 (3.x) and JDK 6 (4).
-
master branch contains code for Netty 4.x
-
3 branch contains code for Netty 3.x