aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod/renderer/LODRenderer.java
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-07 22:05:31 +0200
committermakamys <makamys@outlook.com>2022-06-07 22:06:05 +0200
commit14aafa1180648e3e2bac2f38dc5934a3e4e49974 (patch)
treecc8a415068362994f46dc6302f23481db9fa03fa /src/main/java/makamys/lodmod/renderer/LODRenderer.java
parent7d6ee74f2c6b591bd64532a21d3170889fa5483d (diff)
downloadNeodymium-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.java4
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();