From b179ee4636ac1ae24b724dda5b6faadc31b58c36 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Fri, 14 Dec 2018 23:52:54 +0100 Subject: [PATCH] Commented out broken cleaner --- src/main/java/org/warp/jcwdb/JCWDatabase.java | 2 +- src/main/java/org/warp/jcwdb/exampleimpl/App.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/warp/jcwdb/JCWDatabase.java b/src/main/java/org/warp/jcwdb/JCWDatabase.java index fff1453..d1bcd72 100644 --- a/src/main/java/org/warp/jcwdb/JCWDatabase.java +++ b/src/main/java/org/warp/jcwdb/JCWDatabase.java @@ -40,7 +40,7 @@ public class JCWDatabase implements AutoCloseable, Cleanable { })); this.databaseCleaner = new Cleaner(this); - this.databaseCleaner.start(); + //this.databaseCleaner.start(); } public EntryReference> getRoot() throws IOException { diff --git a/src/main/java/org/warp/jcwdb/exampleimpl/App.java b/src/main/java/org/warp/jcwdb/exampleimpl/App.java index 243271c..aaa9d2f 100644 --- a/src/main/java/org/warp/jcwdb/exampleimpl/App.java +++ b/src/main/java/org/warp/jcwdb/exampleimpl/App.java @@ -57,20 +57,22 @@ public class App { long time2_1 = System.currentTimeMillis(); System.out.println("Time elapsed: " + (time2_1 - time2_0)); ObjectList results = new ObjectArrayList<>(); - + + /* root.forEach((value) -> { if (Animal.hasFourLegs(value)) { results.add(value); } //System.out.println("val:" + value); }); + */ long time2_2 = System.currentTimeMillis(); System.out.println("Time elapsed: " + (time2_2 - time2_1)); System.out.println("Used memory: " + ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 / 1024) + "MB"); System.out.println("Used memory: " + ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 / 1024) + "MB"); System.out.println("Cleaning database (to reduce the amount of used memory and detect memory leaks)..."); - long removedItems = db.clean(); + long removedItems = 0;//db.clean(); time3 = System.currentTimeMillis(); System.out.println("Removed items: " + removedItems); System.out.println("Used memory: " + ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 / 1024) + "MB");