PHP out of memory on stored procedure

Hi,

I have a strange issue. I’ve been using DreamFactory for a while now successfully over several projects. However I’m having issues connection to a stored procedure in an Azure database. When I call the procedure, I get a 200 OK back from the server, however the result contains no data. When I look at the apache log files, I can see the following:

[Tue Oct 13 21:24:01.469250 2015] [:error] [pid 1596] [client 86.138.60.63:29916] PHP Fatal error: Allowed memory size of 4294967296 bytes exhausted (tried to allocate 140080605748824 bytes) in Unknown on line 0…

As you can see, I’ve already increased the PHP allowed memory to 4GB. However each time I increase it, it tries to allocate more. I’m using DF version 1.9.1 on Ubuntu 14.04. Has anyone run across this before?

Out of curiosity, how much data is being returned by the procedure if you call it from your sql tools instead of DreamFactory?

Hi :).

It returns two lines of data, each with 4 fields. Its a total of 74 characters :). The first thing I checked was the amount of data being returned, but the entire database doesn’t hold more than a few hundred MB. I’m using stored procedures with mysql returning 1000’s of lines of data effortlessly, which is why I’m so baffled.

I suspect it’s an issue with php and the ms sql drivers, but I couldn’t find anything about it by googling. Normal POSTs to the database tables are fine, it’s just the POST to a stored procedure with a single parameter. It’s a proper head-scratcher.

Update, I’m guessing it’s related to this: https://bugs.php.net/bug.php?id=67130

Final update! Managed to work out what I was doing wrong. In my POST parameters I had the model wrong. Many apologies, feel like a bit of an idiot now! I was doing:

{“params”:[{
“var_domainId”:“10008”
}]}

I needed to do:

{“params”:[{
“name”: “var_domainId”,
“param_type”: “IN”,
“value”: “10008”
}]}

Hopefully this will help out someone else.

2 Likes

Thanks for posting your solution. Glad it’s not a system wide bug.