@Test
public void connect_RepeatedlyCalled_DoesntLeakMemory() throws Exception {
var sha256 = new Sha256("ab5788279033b0a96f2d342e5f35159f103f69e0191dd391e036a1cd711791a2");
while (true) {
vaas.connect();
var verdict = vaas.forSha256(sha256);
assertEquals(Verdict.MALICIOUS, verdict.getVerdict());
}
}
Check the memory usage (e.g. with htop)
Wait 5min
Check again
Expected
Memory usage does not increase over time (except some GC fluctuations).
Steps to reproduce
Expected
Memory usage does not increase over time (except some GC fluctuations).
Actual
Memory use increase by 1MB per second.