mirror of
https://github.com/PaperMC/Velocity.git
synced 2026-02-17 06:27:42 +01:00
Changes to make Velocity more amenable to memory leak detection
This commit is contained in:
@@ -52,10 +52,9 @@ public class Velocity {
|
||||
System.setProperty("io.netty.native.workdir", System.getProperty("velocity.natives-tmpdir"));
|
||||
}
|
||||
|
||||
// Disable the resource leak detector by default as it reduces performance. Allow the user to
|
||||
// override this if desired.
|
||||
// Set the ADVANCED level of the leak detector. Time to go hunting.
|
||||
if (System.getProperty("io.netty.leakDetection.level") == null) {
|
||||
ResourceLeakDetector.setLevel(Level.DISABLED);
|
||||
ResourceLeakDetector.setLevel(Level.ADVANCED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class MinecraftVarintFrameDecoder extends ByteToMessageDecoder {
|
||||
} else {
|
||||
int minimumRead = bytesRead + readVarint;
|
||||
if (in.isReadable(minimumRead)) {
|
||||
out.add(in.retainedSlice(varintEnd + 1, readVarint));
|
||||
out.add(in.copy(varintEnd + 1, readVarint));
|
||||
in.skipBytes(minimumRead);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user