I wonder if libraries such as freecache[1] and bigcache[2] wouldn't offer a better solution for this use case.<p>[1] <a href="https://github.com/coocood/freecache" rel="nofollow">https://github.com/coocood/freecache</a>
[2] <a href="https://github.com/allegro/bigcache" rel="nofollow">https://github.com/allegro/bigcache</a>
So you use a GC and have occasional CPU usage spikes. You correctly identify the cause. You then use "unsafe" code to go behind the GC's back and build some stuff which probably has crash bugs or worse, and by your analysis solves a problem which was not significant.<p>I shouldn't be surprised. The red flag was flying as soon as IOP was used in singular form.<p>Input/Output Operations Per.