diff options
author | makamys <makamys@outlook.com> | 2022-06-07 22:05:31 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-07 22:06:05 +0200 |
commit | 14aafa1180648e3e2bac2f38dc5934a3e4e49974 (patch) | |
tree | cc8a415068362994f46dc6302f23481db9fa03fa /src/main/java/makamys/lodmod/renderer | |
parent | 7d6ee74f2c6b591bd64532a21d3170889fa5483d (diff) | |
download | Neodymium-14aafa1180648e3e2bac2f38dc5934a3e4e49974.tar.gz Neodymium-14aafa1180648e3e2bac2f38dc5934a3e4e49974.tar.bz2 Neodymium-14aafa1180648e3e2bac2f38dc5934a3e4e49974.zip |
Make GC timing frame-based and more evenly distributed
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer')
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java | 2 | ||||
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODRenderer.java | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java b/src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java index d8c0c27..d14723d 100644 --- a/src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java +++ b/src/main/java/makamys/lodmod/renderer/GPUMemoryManager.java @@ -42,7 +42,7 @@ public class GPUMemoryManager { Mesh startMesh = null; - while(moved < 5 && checksLeft-- > 0 && !sentMeshes.isEmpty()) { + while(moved < 1 && checksLeft-- > 0 && !sentMeshes.isEmpty()) { if(nextMesh >= sentMeshes.size()) { nextMesh = 0; } diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index 3da4603..5b8e467 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -124,10 +124,10 @@ public class LODRenderer { if(LODMod.debugEnabled && Minecraft.getMinecraft().currentScreen == null) { handleKeyboard(); } - if(lastGCTime == -1 || (System.currentTimeMillis() - lastGCTime) > 10) { + if(frameCount % 2 == 0) { mem.runGC(); - lastGCTime = System.currentTimeMillis(); } + lastGCTime = System.currentTimeMillis(); if(lastSaveTime == -1 || (System.currentTimeMillis() - lastSaveTime) > saveInterval && LODMod.saveMeshes) { onSave(); lastSaveTime = System.currentTimeMillis(); |