Commented out broken cleaner

This commit is contained in:
Andrea Cavalli 2018-12-14 23:52:54 +01:00
parent adfdb571d8
commit b179ee4636
2 changed files with 5 additions and 3 deletions

View File

@ -40,7 +40,7 @@ public class JCWDatabase implements AutoCloseable, Cleanable {
})); }));
this.databaseCleaner = new Cleaner(this); this.databaseCleaner = new Cleaner(this);
this.databaseCleaner.start(); //this.databaseCleaner.start();
} }
public <T> EntryReference<LightList<T>> getRoot() throws IOException { public <T> EntryReference<LightList<T>> getRoot() throws IOException {

View File

@ -58,19 +58,21 @@ public class App {
System.out.println("Time elapsed: " + (time2_1 - time2_0)); System.out.println("Time elapsed: " + (time2_1 - time2_0));
ObjectList<Animal> results = new ObjectArrayList<>(); ObjectList<Animal> results = new ObjectArrayList<>();
/*
root.forEach((value) -> { root.forEach((value) -> {
if (Animal.hasFourLegs(value)) { if (Animal.hasFourLegs(value)) {
results.add(value); results.add(value);
} }
//System.out.println("val:" + value); //System.out.println("val:" + value);
}); });
*/
long time2_2 = System.currentTimeMillis(); long time2_2 = System.currentTimeMillis();
System.out.println("Time elapsed: " + (time2_2 - time2_1)); System.out.println("Time elapsed: " + (time2_2 - time2_1));
System.out.println("Used memory: " System.out.println("Used memory: "
+ ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 / 1024) + "MB"); + ((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("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)..."); 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(); time3 = System.currentTimeMillis();
System.out.println("Removed items: " + removedItems); System.out.println("Removed items: " + removedItems);
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");