Ostico / PhpOrient

PhpOrient - Official Php driver based on the binary protocol of OrientDB.
Other
68 stars 37 forks source link

Memory problem #2

Closed Stephanevincenza closed 9 years ago

Stephanevincenza commented 9 years ago

I'm trying your API on a local virtual OrientDB server. Always the same error in my apache log: [Fri Jan 02 16:21:48.154916 2015] [:error] [pid 1340] [client 192.168.1.111:42608] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1819239266 bytes) in /var/www/html/modeles/PhpOrient/src/PhpOrient/Protocols/Binary/OrientSocket.php on line 135

andreyvk commented 9 years ago

Looks like you are trying to pull to much data at a time. This is not a library problem, but a memory_limit variable set in php.ini file on your system. Alternatively you can add this line of code at the beginning of your script

ini_set('memory_limit', '512M');

Or smth similar.

Sent from my iPhone

On 2 Jan, 2015, at 21:29, Stephanevincenza notifications@github.com wrote:

I'm trying your API on a local virtual OrientDB server. Always the same error in my apache log: [Fri Jan 02 16:21:48.154916 2015] [:error] [pid 1340] [client 192.168.1.111:42608] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1819239266 bytes) in /var/www/html/modeles/PhpOrient/src/PhpOrient/Protocols/Binary/OrientSocket.php on line 135

— Reply to this email directly or view it on GitHub.

Stephanevincenza commented 9 years ago

First of all , thanks for your answer. But that's not the problem.... I know th function ini_set(), but if you have a look on my log, you'll see that the script needs more than 1GB to execute. And my script just tries to connect........ have a look on my entire php :

<?php header( 'content-type: text/html; charset=utf-8' ); require "PhpOrient/vendor/autoload.php"; use PhpOrient\PhpOrient; $client = new PhpOrient(); $client->configure( array( 'username' => 'root', 'password' => 'steph', 'hostname' => 'localhost', 'port' => 2424, ) ); $client->connect(); $reponse=$client->dbList(); print_r($reponse); $ClusterMap = $client->dbOpen( 'DB_patate', 'admin', 'admin' ); ?>

So the line that seems to bug is $ClusterMap = $client->dbOpen( 'DB_patate', 'admin', 'admin' ); And my database is empty......... sic...

2015-01-02 16:39 GMT+01:00 Andrey notifications@github.com:

Looks like you are trying to pull to much data at a time. This is not a library problem, but a memory_limit variable set in php.ini file on your system. Alternatively you can add this line of code at the beginning of your script

ini_set('memory_limit', '512M');

Or smth similar.

Sent from my iPhone

On 2 Jan, 2015, at 21:29, Stephanevincenza notifications@github.com wrote:

I'm trying your API on a local virtual OrientDB server. Always the same error in my apache log: [Fri Jan 02 16:21:48.154916 2015] [:error] [pid 1340] [client 192.168.1.111:42608] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1819239266 bytes) in /var/www/html/modeles/PhpOrient/src/PhpOrient/Protocols/Binary/OrientSocket.php on line 135

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/Ostico/PhpOrient/issues/2#issuecomment-68535186.

Ostico commented 9 years ago

Hi @Stephanevincenza, this seems to be some kind of bug related to your system/PHP and/or OrientDB version. Can you tell me what version of PHP, OrientDB and OS you have? I've to try to reproduce the problem to fix it

andreyvk commented 9 years ago

That's strange. I've tried a similar piece of code on my system just a couple of days back. That seemed to work well... Lets see ur system info. Meanwhile, i'll try ur code on my vm.

Sent from my iPhone

On 2 Jan, 2015, at 21:48, Stephanevincenza notifications@github.com wrote:

First of all , thanks for your answer. But that's not the problem.... I know th function ini_set(), but if you have a look on my log, you'll see that the script needs more than 1GB to execute. And my script just tries to connect........ have a look on my entire php :

<?php header( 'content-type: text/html; charset=utf-8' ); require "PhpOrient/vendor/autoload.php"; use PhpOrient\PhpOrient; $client = new PhpOrient(); $client->configure( array( 'username' => 'root', 'password' => 'steph', 'hostname' => 'localhost', 'port' => 2424, ) ); $client->connect(); $reponse=$client->dbList(); print_r($reponse); $ClusterMap = $client->dbOpen( 'DB_patate', 'admin', 'admin' ); ?>

So the line that seems to bug is $ClusterMap = $client->dbOpen( 'DB_patate', 'admin', 'admin' ); And my database is empty......... sic...

2015-01-02 16:39 GMT+01:00 Andrey notifications@github.com:

Looks like you are trying to pull to much data at a time. This is not a library problem, but a memory_limit variable set in php.ini file on your system. Alternatively you can add this line of code at the beginning of your script

ini_set('memory_limit', '512M');

Or smth similar.

Sent from my iPhone

On 2 Jan, 2015, at 21:29, Stephanevincenza notifications@github.com wrote:

I'm trying your API on a local virtual OrientDB server. Always the same error in my apache log: [Fri Jan 02 16:21:48.154916 2015] [:error] [pid 1340] [client 192.168.1.111:42608] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1819239266 bytes) in /var/www/html/modeles/PhpOrient/src/PhpOrient/Protocols/Binary/OrientSocket.php on line 135

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/Ostico/PhpOrient/issues/2#issuecomment-68535186.

— Reply to this email directly or view it on GitHub.

Ostico commented 9 years ago

I found an issue in OrientDB v1.7.10 configuration, if you use this version try with this fix:

https://github.com/orientechnologies/orientdb/issues/3324

andreyvk commented 9 years ago

Works fine for me. Im using OrientDB 2.0-rc1 with PhpOrient v1.0.0 running on nginx 1.4.6 with php 5.5.9 on Ubuntu 14.04

Stephanevincenza commented 9 years ago

Amazing reactivity !!!! You're incredible !!! My configuration: VM server with ubuntu 14.04, php 5.5.9 and orientDB 1.7.10 The orientDB server is launched in distributed mode (with dserver.sh) Domenico, sorry but the issue you told about doesn't concern my configuration....

2015-01-02 20:48 GMT+01:00 Andrey notifications@github.com:

Works fine for me. Im using OrientDB 2.0-rc1 with PhpOrient v1.0.0 running on nginx 1.4.6 with php 5.5.9 on Ubuntu 14.04

— Reply to this email directly or view it on GitHub https://github.com/Ostico/PhpOrient/issues/2#issuecomment-68556082.

Ostico commented 9 years ago

Found a bug that i have already fixed in PyOrient when the server starts in distributed mode.

Now should work, update your sources and let me know if it works.

Stephanevincenza commented 9 years ago

Great !!! Works fine.

2015-01-02 22:37 GMT+01:00 Domenico Lupinetti notifications@github.com:

Closed #2 https://github.com/Ostico/PhpOrient/issues/2.

— Reply to this email directly or view it on GitHub https://github.com/Ostico/PhpOrient/issues/2#event-213568280.