> Make sense. > There are second level config for the memory detection. The first level is > netty jvm param `-Dio.netty.leakDetection.level`, the second level is > bookkeeper config `AbstractConfiguration#setAllocatorLeakDetectionPolicy`. > > If the second level be config greater than `Disabled`, the second level will > override the first level. > If the second level is `Disabled`, we use the first level config.
The default detection level in netty is `Simple`, the default detection level in bookkeeper is `Disabled`. If the user didn't config the bookkeeper level detection policy, it will use netty default detection level `Simple`, it's a breaking change. So I suggest that we introduce a new jvm param `preferNettyLeakDetectionPolicy` in bookkeeper, the default value is `false`. If the user config `-DpreferNettyReLeakDetectionPolicy=true`, the bookkeeper leak detection policy won't override the netty config. If the ci tests, we config `-Dio.netty.leakDetection.level=paranoid -DpreferNettyLeakDetectionPolicy=true`, it will use netty leak detection level `paranoid`.