GDATASoftwareAG / vaas

Verdict-as-a-Service SDKs: Analyze files for malicious content
https://www.gdata.de/business/security-services/verdict-as-a-service
MIT License
36 stars 10 forks source link

Java: Repeated calls to connect() leak memory #647

Closed pstadermann closed 1 week ago

pstadermann commented 1 week ago

Steps to reproduce

    @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());
        }
    }

Expected

Memory usage does not increase over time (except some GC fluctuations).

Actual

Memory use increase by 1MB per second.