mem pool visualization
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-05-25 19:41:08 -04:00
parent a413b9aa79
commit e0b22d2949
3 changed files with 23 additions and 0 deletions

View File

@ -44,5 +44,13 @@ public class TerrainChunkDataPool {
TerrainChunkDataPool.pool.add(data);
lock.unlock();
}
/**
* Gets the size of the chunk pool
* @return The size of the chunk pool
*/
public static int getPoolSize(){
return pool.size();
}
}

View File

@ -4,7 +4,9 @@ import java.lang.management.GarbageCollectorMXBean;
import java.lang.management.ManagementFactory;
import java.util.List;
import electrosphere.client.terrain.data.TerrainChunkDataPool;
import electrosphere.engine.Globals;
import electrosphere.mem.BlockChunkPool;
import electrosphere.renderer.ui.imgui.ImGuiLinePlot;
import electrosphere.renderer.ui.imgui.ImGuiLinePlot.ImGuiLinePlotDataset;
import electrosphere.renderer.ui.imgui.ImGuiWindow;
@ -73,6 +75,11 @@ public class ImGuiMemory {
System.gc();
}
if(ImGui.collapsingHeader("Object Pools")){
ImGui.text("Block Chunk Pool: " + BlockChunkPool.getPoolSize());
ImGui.text("Terrain Chunk Pool: " + TerrainChunkDataPool.getPoolSize());
}
//memory usage graph
memoryGraphDataset.addPoint(memoryUsage);
memoryGraph.draw();

View File

@ -50,4 +50,12 @@ public class BlockChunkPool {
lock.unlock();
}
/**
* Gets the size of the short pool
* @return The size of the short pool
*/
public static int getPoolSize(){
return shortPool.size();
}
}