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/LODRenderer.java | |
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/LODRenderer.java')
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODRenderer.java | 4 |
1 files changed, 2 insertions, 2 deletions
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(); |