I'm experiencing short lag spikes after some voxel chunks have been created while not moving the camera around. I profiled the application: the JVM implementation uses a lot more memory, about 2.5 times more, compared to c++ exact implementation. Also, according to the profiler, the cause of the lag is the garbage collector. But there is nothing to collect ! All voxel data is static, references are kept, nothing gets allocated while profiling. I also turned off all the rendering to make sure that native memory is not leaking. Still lagging.
What could be it ? If you need any code, I'll add it here. (Writing in scala)