From 34383705449a488878701026ae6a030ba5752ab1 Mon Sep 17 00:00:00 2001 From: Louis Vallat Date: Sat, 27 Apr 2019 10:55:34 +0200 Subject: [PATCH] minor memory optimizations there are memory leaks in the code but I can't find where. --- .../src/TwitterTechSupportGoreBot/Hypervisor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/twitter_techsupportgore_bot/src/TwitterTechSupportGoreBot/Hypervisor.java b/twitter_techsupportgore_bot/src/TwitterTechSupportGoreBot/Hypervisor.java index 7ea0808..615bee9 100644 --- a/twitter_techsupportgore_bot/src/TwitterTechSupportGoreBot/Hypervisor.java +++ b/twitter_techsupportgore_bot/src/TwitterTechSupportGoreBot/Hypervisor.java @@ -159,7 +159,10 @@ public class Hypervisor { for (;;) { for (RedditPost post : myRedditExtractor.getRedditPosts()) { computeRedditPost(post); + post = null; } + System.out.println("[*] Cleaning memory."); + System.gc(); System.out.println( "[*] Hypervisor is waiting for " + this.delay + " seconds."); Thread.sleep(this.delay * 1000);