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.start();
//this.databaseCleaner.start();
}
public <T> EntryReference<LightList<T>> getRoot() throws IOException {

View File

@ -57,20 +57,22 @@ public class App {
long time2_1 = System.currentTimeMillis();
System.out.println("Time elapsed: " + (time2_1 - time2_0));
ObjectList<Animal> 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");