I seem to have found a way to make NIO leak 100Mb in about 2-4 seconds. And, usually, that memory is unrecoverable.
Since it's native memory being leaked, the JVM doesn't claim to possess it (System.Runtime reports only about 4Mb extra memory used from before the leak to after), although linux betrays the process as having shot from 24Mb to sometimes as high as 220Mb in just a few seconds.
Sometimes, System.gc() will recover up to 25% of the lost RAM. Usually, it will only recover 5% at most.
This has a catastrophic effect on the system. I was wondering if anyone has had any experience with NIO memory leaks? The last memory leak I found was in 1.3 (to do with files) and I'd hoped never to find one again
. At the moment, I'm struggling to come up with an isolated small test-case: note that I can reproduce the problem 100% of the time BUT it is dependent upon several things that make it damn hard to turn into a test case - including the fact that if you make the same series of requests sequentially, LITTLE OR NO MEMORY IS LEAKED, but if you make them in parallel, with just the right timing, Boom!
FYI I've tried different tools to issue parallel requests, and although they functionally all do the same thing, only SOME of them cause the system to explode