peec / raspberry-piface-api

PiFace PHP 5.4+ API for Raspberry PI PiFace module.
13 stars 2 forks source link

PiFaceDigital potential memory leak in getValue(); #5

Closed primerpop closed 8 years ago

primerpop commented 8 years ago

Now I realize this could be something underlying in SPI, but let me explain.

Using piface-api in a usleep loop to read the values of the various digital ins. I've noticed in dmesg that my code results in an OOM error and is killed. Investigating this code further, I'm basically looping a shutdown condition that then runs a foreach on each pin obtained from getInputPins();

If I comment out the getValue line, memory use remains static, no measurable increase on peak consumption.

Code can be seen in https://github.com/primerpop/php-piMind/blob/master/sensors/piface-spi.php within method realtime() near about line 120.

Do you have any advice or recommendations on this? I have basically had to wrap the aforementioned script in a bash script to relaunch it when it OOMs, which is kinda ghetto.

TIA

primerpop commented 8 years ago

The issue was in php_spi, no trouble found here sir.