FirebirdSQL / php-firebird

Firebird PHP driver
Other
66 stars 15 forks source link

Memory leaks fixed #30

Closed KoudelkaB closed 2 years ago

MartinKoeditz commented 2 years ago

@KoudelkaB Do you have an example code for the leak? In that case we can create a unit test.

KoudelkaB commented 2 years ago

The code to reproduce the leak is very simple: for ($idx = 1; $idx <= 2000; $idx++) { $h = @ibase_prepare('SELECT * FROM DATASTORE'); $result = ibase_execute($h); ibase_free_result($result); ibase_free_query($h);

        unset($h);
        unset($result);

        if ($idx % 100 === 0) {
            echo CONSOLE(
                sprintf(
                    "Queries executed: %d. Memory: %s\n",
                    $idx,
                    Benchmark::getMemoryPeakUsage(true)
                )
            );
        }
    }