Temporarily increase write buffer size

This commit is contained in:
Jesse Boyd 2017-10-07 18:54:40 +11:00
parent 6db70e6058
commit f098dba70a
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -84,6 +84,9 @@ public class MCAFile2LevelDB extends MapConverter {
try (PrintStream out = new PrintStream(new FileOutputStream(new File(folderTo, "levelname.txt")))) { try (PrintStream out = new PrintStream(new FileOutputStream(new File(folderTo, "levelname.txt")))) {
out.print(worldName); out.print(worldName);
} }
// long presumableFreeMemory = Runtime.getRuntime().maxMemory() - allocatedMemory;
this.pool = new ForkJoinPool(); this.pool = new ForkJoinPool();
this.remapper = new ClipboardRemapper(ClipboardRemapper.RemapPlatform.PC, ClipboardRemapper.RemapPlatform.PE); this.remapper = new ClipboardRemapper(ClipboardRemapper.RemapPlatform.PC, ClipboardRemapper.RemapPlatform.PE);
BundledBlockData.getInstance().loadFromResource(); BundledBlockData.getInstance().loadFromResource();
@ -93,7 +96,7 @@ public class MCAFile2LevelDB extends MapConverter {
.verifyChecksums(false) .verifyChecksums(false)
.blockSize(262144) // 256K .blockSize(262144) // 256K
.cacheSize(8388608) // 8MB .cacheSize(8388608) // 8MB
.writeBufferSize(134217728) // >=128MB .writeBufferSize(1342177280) // >=128MB
); );
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
@ -149,6 +152,7 @@ public class MCAFile2LevelDB extends MapConverter {
" - Any custom generator settings may not work\n" + " - Any custom generator settings may not work\n" +
" - May not match up with new terrain" " - May not match up with new terrain"
); );
Fawe.debug("Starting compaction");
compact(); compact();
app.prompt("Compaction complete!"); app.prompt("Compaction complete!");
} }
@ -261,9 +265,7 @@ public class MCAFile2LevelDB extends MapConverter {
} }
} }
} }
pool.submit(new Runnable() { pool.submit((Runnable) () -> {
@Override
public void run() {
try { try {
update(getKey(chunk, Tag.Version), VERSION); update(getKey(chunk, Tag.Version), VERSION);
update(getKey(chunk, Tag.FinalizedState), COMPLETE_STATE); update(getKey(chunk, Tag.FinalizedState), COMPLETE_STATE);
@ -314,7 +316,7 @@ public class MCAFile2LevelDB extends MapConverter {
if (!chunk.entities.isEmpty()) { if (!chunk.entities.isEmpty()) {
List<com.sk89q.jnbt.Tag> entities = new ArrayList<>(); List<com.sk89q.jnbt.Tag> entities = new ArrayList<>();
for (com.sk89q.jnbt.CompoundTag tag : chunk.getEntities()) { for (CompoundTag tag : chunk.getEntities()) {
transform(chunk, tag); transform(chunk, tag);
entities.add(tag); entities.add(tag);
} }
@ -355,7 +357,6 @@ public class MCAFile2LevelDB extends MapConverter {
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
} }
}
}); });
} }