minor memory optimizations

there are memory leaks in the code but I can't find where.
This commit is contained in:
Louis Vallat 2019-04-27 10:55:34 +02:00
parent 0afc9e05ba
commit 3438370544

View File

@ -159,7 +159,10 @@ public class Hypervisor {
for (;;) { for (;;) {
for (RedditPost post : myRedditExtractor.getRedditPosts()) { for (RedditPost post : myRedditExtractor.getRedditPosts()) {
computeRedditPost(post); computeRedditPost(post);
post = null;
} }
System.out.println("[*] Cleaning memory.");
System.gc();
System.out.println( System.out.println(
"[*] Hypervisor is waiting for " + this.delay + " seconds."); "[*] Hypervisor is waiting for " + this.delay + " seconds.");
Thread.sleep(this.delay * 1000); Thread.sleep(this.delay * 1000);