Go to file
Trustin Lee 337f5bbb8e Automatic diagnosis of resource leaks
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.
2013-01-15 14:15:27 +09:00
all Fix the incorrect snapshot version number 2012-12-13 22:49:31 +09:00
buffer Automatic diagnosis of resource leaks 2013-01-15 14:15:27 +09:00
codec Replace and merge DetectionUtil and DirectByteBufUtil into PlatformDependent and PlatformDependent0 2013-01-11 14:03:27 +09:00
codec-http SPDY: fix regression in SpdyFrameDecoder.decodeHeaderBlock() 2013-01-14 10:58:03 -08:00
codec-socks Fix various inspection warnings 2013-01-10 15:23:58 +09:00
common Automatic diagnosis of resource leaks 2013-01-15 14:15:27 +09:00
example Rename from io.netty.transport.* to io.netty.channel.* 2013-01-14 21:34:58 +01:00
handler Replace and merge DetectionUtil and DirectByteBufUtil into PlatformDependent and PlatformDependent0 2013-01-11 14:03:27 +09:00
license Add Snappy compression codec 2012-12-18 21:09:31 +01:00
metrics-yammer Clean up netty-metrics-yammer pom.xml 2013-01-11 00:16:06 +09:00
microbench Remove ChannelBuf/ByteBuf.Unsafe 2012-12-17 17:41:21 +09:00
tarball [#840] Generate the tarball with top level directory 2012-12-30 21:26:08 +01:00
testsuite Moved sctp transport classes from io.netty.channel.socket.sctp to it's own subpackage io.netty.channel.sctp 2013-01-14 21:27:49 +01:00
transport Fix a bug where ChannelPIpeline.remove/replace() fails when its channel is not registered yet 2013-01-14 21:50:08 +09:00
transport-rxtx Rename from io.netty.transport.* to io.netty.channel.* 2013-01-14 21:34:58 +01:00
transport-sctp Moved sctp transport classes from io.netty.channel.socket.sctp to it's own subpackage io.netty.channel.sctp 2013-01-14 21:27:49 +01:00
transport-udt Rename from io.netty.transport.* to io.netty.channel.* 2013-01-14 21:34:58 +01:00
.fbfilter.xml Update license headers 2012-06-04 13:31:44 -07:00
.fbprefs Updated Find Bugs configuration 2009-03-04 10:33:09 +00:00
.gitignore ignore .idea/ folder 2012-01-16 16:01:00 +08:00
LICENSE.txt Relicensed to Apache License v2 2009-08-28 07:15:49 +00:00
NOTICE.txt Add some of the metrics mentioned in #718 2013-01-04 11:27:49 +01:00
pom.xml Remove the memory option previously added to avoid OOME 2013-01-10 16:25:41 +09:00
README.md Fix README 2012-09-08 20:20:45 +02:00

The Netty Project

Netty is an asynchronous event-driven network application framework for rapid development of maintainable high performance protocol servers & clients.

Getting Netty

    <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