mirror of https://github.com/cabaletta/baritone
memory leaks are joever
This commit is contained in:
parent
15f4253b3d
commit
8211ae4af5
|
@ -622,6 +622,13 @@ public final class Settings {
|
||||||
*/
|
*/
|
||||||
public final Setting<Boolean> pruneRegionsFromRAM = new Setting<>(true);
|
public final Setting<Boolean> pruneRegionsFromRAM = new Setting<>(true);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The chunk packer queue can never grow to larger than this, if it does, the oldest chunks are discarded
|
||||||
|
* <p>
|
||||||
|
* The newest chunks are kept, so that if you're moving in a straight line quickly then stop, your immediate render distance is still included
|
||||||
|
*/
|
||||||
|
public final Setting<Integer> chunkPackerQueueMaxSize = new Setting<>(2000);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill in blocks behind you
|
* Fill in blocks behind you
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -307,6 +307,9 @@ public final class CachedWorld implements ICachedWorld, Helper {
|
||||||
try {
|
try {
|
||||||
ChunkPos pos = toPackQueue.take();
|
ChunkPos pos = toPackQueue.take();
|
||||||
Chunk chunk = toPackMap.remove(pos);
|
Chunk chunk = toPackMap.remove(pos);
|
||||||
|
if (toPackQueue.size() > Baritone.settings().chunkPackerQueueMaxSize.value) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
CachedChunk cached = ChunkPacker.pack(chunk);
|
CachedChunk cached = ChunkPacker.pack(chunk);
|
||||||
CachedWorld.this.updateCachedChunk(cached);
|
CachedWorld.this.updateCachedChunk(cached);
|
||||||
//System.out.println("Processed chunk at " + chunk.x + "," + chunk.z);
|
//System.out.println("Processed chunk at " + chunk.x + "," + chunk.z);
|
||||||
|
|
Loading…
Reference in New Issue