tarantool/tarantool-php

Утекает память при update

AKEB opened this issue · 9 comments

AKEB commented

При вызове метода update или upsert скрипт падает по памяти!
при insert, все хорошо

<?php
ini_set('memory_limit', '10M');

$tnt = new Tarantool(TARANTOOL_HOST, TARANTOOL_PORT, TARANTOOL_USER, TARANTOOL_PASSWD);
for ($i=1;$i<=1000000;$i++) {
	$tuple = array($i,md5($i));
	$ops = array(array(
		"field" => 2,
		"op" => "=",
		"arg" => $tuple[1]
	));
	if ($i % 100 == 0) echo "MEMORY \t".memory_get_usage(1)." \t $i\n";
	//$tnt->insert('tester', $tuple);
	$tnt->update('tester', $i, $ops);
	//$tnt->upsert('tester', $tuple, $ops);
}
MEMORY 	10485760 	 13800

Fatal error: Allowed memory size of 10485760 bytes exhausted (tried to allocate 40 bytes) in /Users/AKEB/Documents/WWWRoot/MRGService/wwwroot/tarantool_import.php on line 38

Paste you php-config, uname -a and lsb-release -a, please

AKEB commented
Usage: /Applications/AMPPS/php/bin/php-config [OPTION]
Options:
  --prefix            [/Applications/AMPPS/php-5.6]
  --includes          [-I/Applications/AMPPS/php-5.6/include/php -I/Applications/AMPPS/php-5.6/include/php/main -I/Applications/AMPPS/php-5.6/include/php/TSRM -I/Applications/AMPPS/php-5.6/include/php/Zend -I/Applications/AMPPS/php-5.6/include/php/ext -I/Applications/AMPPS/php-5.6/include/php/ext/date/lib]
  --ldflags           [ -L/Applications/AMPPS/extra/lib]
  --libs              [  -lcrypto -lssl -lcrypto -lresolv -lstdc++ -lm  -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm ]
  --extension-dir     [/Applications/AMPPS/php-5.6/lib/extensions/no-debug-non-zts-20131226]
  --include-dir       [/Applications/AMPPS/php-5.6/include/php]
  --man-dir           [/Applications/AMPPS/php-5.6/php/man]
  --php-binary        [/Applications/AMPPS/php-5.6/bin/php]
  --php-sapis         [ apache2handler cli cgi]
  --configure-options [--prefix=/Applications/AMPPS/php-5.6 --with-config-file-path=/Applications/AMPPS/php-5.6/etc --with-config-file-scan-dir=/Applications/AMPPS/php-5.6/etc/php.d --includedir=/Applications/AMPPS/php-5.6/include --libdir=/Applications/AMPPS/php-5.6/lib --enable-opcache --with-jpeg-dir=/Applications/AMPPS/extra --with-png-dir=/Applications/AMPPS/extra --with-freetype-dir=/Applications/AMPPS/extra --enable-inline-optimization --disable-debug --enable-cli --enable-cgi --enable-force-cgi-redirect --enable-fastcgi --with-apxs2=/Applications/AMPPS/apache/bin/apxs --enable-discard-path --enable-filepro --enable-ipv6 --enable-path-info-check --enable-magic-quotes --enable-track-vars --enable-trans-sid --enable-yp --enable-zts --enable-xmlrpc --without-gdbm --enable-xslt=/Applications/AMPPS/extra --with-xsl=shared,/Applications/AMPPS/extra --with-tidy=shared,/Applications/AMPPS/extra --without-pear --enable-sockets=shared,/Applications/AMPPS/extra --with-mime-magic --enable-fileinfo --enable-zend-multibyte --with-zlib-dir=/Applications/AMPPS/extra --with-zlib=shared,/Applications/AMPPS/extra --enable-zlib=shared,/Applications/AMPPS/extra --enable-zip=shared,/Applications/AMPPS/extra --with-libxml-dir=/Applications/AMPPS/extra --with-xml --enable-xmlreader --enable-xmlwriter --with-simplexml --with-ncurses=shared,/Applications/AMPPS/extra/bin/ncurses5-config --with-gd=shared --enable-gd-imgstrttf --enable-gd-native-ttf --without-xpm --with-gettext=shared,/Applications/AMPPS/extra --with-bz2=shared,/Applications/AMPPS/extra --enable-bcmath=shared --enable-calendar=shared --enable-ctype=shared --enable-filter --enable-exif=shared --enable-ftp=shared --enable-hash --enable-json --enable-shmop=shared --disable-sigchild --enable-sysvsem=shared --enable-sysvshm=shared --enable-reflection=shared --enable-session --enable-spl --enable-tokenizer=shared --enable-wddx=shared --enable-mysqlnd --with-mysql=shared,/Applications/AMPPS/mysql --with-mysqli=shared,/Applications/AMPPS/mysql/bin/mysql_config --with-pgsql=shared,/Applications/AMPPS/extra --with-openssl=shared,/Applications/AMPPS/extra --with-ldap=shared,/Applications/AMPPS/extra --with-mcrypt=shared,/Applications/AMPPS/extra --with-mhash=shared,/Applications/AMPPS/extra --enable-mbstring=shared --enable-mbstr-enc-trans --enable-mbregex --enable-mbregex-backtrack --with-curl=shared,/Applications/AMPPS/extra --enable-dba=shared --enable-dbase=shared --with-fdf=shared --enable-pdo --with-pdo-mysql=shared,/Applications/AMPPS/mysql/bin/mysql_config --with-pdo-mssql=shared,/Applications/AMPPS/extra --with-pdo-sqlite=shared,/Applications/AMPPS/extra --with-pdo-sqlite-external --with-sqlite=shared,/Applications/AMPPS/extra --with-sqlite3=shared,/Applications/AMPPS/extra --with-pdo-dblib=shared,/Applications/AMPPS/extra --with-pdo-pgsql=shared,/Applications/AMPPS/extra --enable-soap=shared --enable-pcntl=shared --enable-dbx=shared --with-iconv=shared,/Applications/AMPPS/extra --with-imap=shared,/Applications/AMPPS/extra/lib/imap-2007f --with-imap-ssl=shared,/Applications/AMPPS/extra --with-kerberos --with-pdf=shared --enable-phar --enable-intl=shared --with-icu-dir=/Applications/AMPPS/extra --with-ssh2=shared,/Applications/AMPPS/extra LDFLAGS=-L/Applications/AMPPS/extra/lib CPPFLAGS=-I/Applications/AMPPS/extra/include]
  --version           [5.6.31]
  --vernum            [50631]
AKEB commented
AKEB:bin AKEB$ uname -a
Darwin AKEB 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64
AKEB commented
AKEB:bin AKEB$ lsb-release -a
-bash: lsb-release: command not found

php7 is not an option? this bug is fixed on php7-v2 branch

AKEB commented

We use php 5.4.23-pl0-gentoo on Server
But I use 5.6.31 on my comp

@AKEB Active support for php 5.6 ended on 19 Jan 2017 and security support ends in 10 months: http://php.net/supported-versions.php.

I'm not sure that we're building on php5.4 at all

AKEB commented

thanx