Unable to Close FileChannel, opened with NIO

Shame on me, preallocate memory did the trick! 200millis is acceptable.

I think I have options now, I will totally consider using this method. But I’ll also decide if waiting the GC to release files, may be the best option for this implementation.

Thanks for the knowledge ones again!

Not sure if you noticed, but in my tests this method is faster than the memory mapped files if you have the right buffer size.

How big can the buffer size be? That would be my only doubt!

Maybe any clue I can find in ignition.conf?

The fastest in my test was only ~256kb, and that was only marginally faster than ~128kb. ~512kb started to be slower.

It has nothing to do with ignition.conf. It’s barely a drop in the memory bucket.

1 Like

Hmmm, ok awesome.

I suppose the real answer is the perfect buffer size would depend on your OS, file system, SSD/driver, and maybe the size of the files you’re comparing. Maybe even CPU caches sizes.

But I think this is all just close enough.

1 Like

Haha great, this turned into something unexpectedly interesting!