possible database memory leak

Notice: This thread is very old.

7 years ago

šuf
Member | 14
+
0
-

Following script seems to generate memory leak. With each cycle, the memory usage grows by 8 MB (up to 57 MB in last one).

require '../nette/Nette/loader.php';
use Nette\Database\Connection;


$configurator = new Nette\Config\Configurator;
$configurator->setTempDirectory(__DIR__ . '/cache');
$configurator->addConfig(__DIR__ . '/config/config.neon');
$container = $configurator->createContainer();
$database = $container->database;


for($i=0;$i<10;$i++)
{
    echo "<br>".memory_get_usage();
    $sold = $database->query('select * from offers limit 10000'); // prostě velký select
}

using
2.0.12 (revision 80a7e46 released on 2013–08–08),

the config.neon contains only ( after advice from https://forum.nette.org/…vani-queries#… ):
nette:
database:
default:
dsn: “mysql:host=localhost;dbname=offers”
driver: mysql
debugger: false
user: xxxxx
password: xxxxx
host: localhost
profiler: false
services:
database: @Nette\Database\Connection

7 years ago

frosty22
Member | 373
+
0
-

https://forum.nette.org/…memory-leaks

It was fixed in https://github.com/…tte/pull/919 so you must update your nette version.

7 years ago

šuf
Member | 14
+
0
-

I DO have the latest version…

7 years ago

David Grudl
Nette Core | 7067
+
0
-

It is fixed only in master, because it required to rewrite Connection & Statement classes.

7 years ago

šuf
Member | 14
+
0
-

solved, thx

Last edited by šuf (2013-08-14 13:37)