Let's start a new thread discussing some possible optimization. Immortius already contributed a nice profiler and some tweaks. So it's my turn... 
I've finally fixed the stuttering issues on my machine when using the largest viewing distance and playing for a short while. The cause is quite obvious though. That many VBOs, which are used to store the chunk vertices on the GPU, actually use a significant amount of memory. I've profiled my GPU's VRAM while playing and used our nice new profiler to track down peaks. This led me to the cause: the VBO drawing calls. Many VBOs have been moved to the system memory at this point. So accessing and rendering some of the cached chunks became REALLY slow.
As a solution I've added a mechanism that limits the amount of concurrent VBOs stored on the GPU. If the limit is exceeded, those chunks get marked as dirty and the corresponding VBOs are deleted. I've set the limit to 512 VBOs which is enough to display all the chunks (and some more) in the view frustum on the largest viewing distance. If the player starts to look around, some VBOs have to be recreated again using the voxel data.
Currently running a demo flight for almost an hour now and my VRAM has not exceed 600 MB. Before it rose to 1024 MB and started to fill up my system memory.
I've finally fixed the stuttering issues on my machine when using the largest viewing distance and playing for a short while. The cause is quite obvious though. That many VBOs, which are used to store the chunk vertices on the GPU, actually use a significant amount of memory. I've profiled my GPU's VRAM while playing and used our nice new profiler to track down peaks. This led me to the cause: the VBO drawing calls. Many VBOs have been moved to the system memory at this point. So accessing and rendering some of the cached chunks became REALLY slow.
As a solution I've added a mechanism that limits the amount of concurrent VBOs stored on the GPU. If the limit is exceeded, those chunks get marked as dirty and the corresponding VBOs are deleted. I've set the limit to 512 VBOs which is enough to display all the chunks (and some more) in the view frustum on the largest viewing distance. If the player starts to look around, some VBOs have to be recreated again using the voxel data.
Currently running a demo flight for almost an hour now and my VRAM has not exceed 600 MB. Before it rose to 1024 MB and started to fill up my system memory.