mem pool visualization
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
a413b9aa79
commit
e0b22d2949
@ -44,5 +44,13 @@ public class TerrainChunkDataPool {
|
|||||||
TerrainChunkDataPool.pool.add(data);
|
TerrainChunkDataPool.pool.add(data);
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the size of the chunk pool
|
||||||
|
* @return The size of the chunk pool
|
||||||
|
*/
|
||||||
|
public static int getPoolSize(){
|
||||||
|
return pool.size();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,9 @@ import java.lang.management.GarbageCollectorMXBean;
|
|||||||
import java.lang.management.ManagementFactory;
|
import java.lang.management.ManagementFactory;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import electrosphere.client.terrain.data.TerrainChunkDataPool;
|
||||||
import electrosphere.engine.Globals;
|
import electrosphere.engine.Globals;
|
||||||
|
import electrosphere.mem.BlockChunkPool;
|
||||||
import electrosphere.renderer.ui.imgui.ImGuiLinePlot;
|
import electrosphere.renderer.ui.imgui.ImGuiLinePlot;
|
||||||
import electrosphere.renderer.ui.imgui.ImGuiLinePlot.ImGuiLinePlotDataset;
|
import electrosphere.renderer.ui.imgui.ImGuiLinePlot.ImGuiLinePlotDataset;
|
||||||
import electrosphere.renderer.ui.imgui.ImGuiWindow;
|
import electrosphere.renderer.ui.imgui.ImGuiWindow;
|
||||||
@ -73,6 +75,11 @@ public class ImGuiMemory {
|
|||||||
System.gc();
|
System.gc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ImGui.collapsingHeader("Object Pools")){
|
||||||
|
ImGui.text("Block Chunk Pool: " + BlockChunkPool.getPoolSize());
|
||||||
|
ImGui.text("Terrain Chunk Pool: " + TerrainChunkDataPool.getPoolSize());
|
||||||
|
}
|
||||||
|
|
||||||
//memory usage graph
|
//memory usage graph
|
||||||
memoryGraphDataset.addPoint(memoryUsage);
|
memoryGraphDataset.addPoint(memoryUsage);
|
||||||
memoryGraph.draw();
|
memoryGraph.draw();
|
||||||
|
|||||||
@ -50,4 +50,12 @@ public class BlockChunkPool {
|
|||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the size of the short pool
|
||||||
|
* @return The size of the short pool
|
||||||
|
*/
|
||||||
|
public static int getPoolSize(){
|
||||||
|
return shortPool.size();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user