Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

fDatabase memory size exhausted.

posted by darren 8 years ago


I am doing an oracle sql query where it returns around 180k rows which i then feed off to as csv class to so the user can download the file.

However fDatabase dumps on me before that with...

Fatal error: Allowed memory size of 947912704 bytes exhausted (tried to allocate 11 bytes) in /path/flourish/fDatabase.php on line 2485

If i limit the query to 81k rows its fine.

Any ideas?



If you are dumping to a CSV you probably don't want the query to be buffered, which is the default. Buffering the request pulls the results into memory so you don't have to worry about issues with multiple queries being active on a single connection.

fDatabase#UnbufferedQueries talks about how to run an unbuffered query, which should use significantly less memory.

posted by wbond 8 years ago

Hi Will,

No joy either...

Fatal error: Allowed memory size of 444596224 bytes exhausted (tried to allocate 49 bytes) in /path/flourish/fUnbufferedResult.php on line 345

The other thing is in the docs it said -

"If another database query is called, it will either cause the previous call to close or will fail itself."

This this not ideal in my case as i could have multiple people accessing the request...

Any thoughts?


posted by darren 8 years ago

Hmm, that implies to be that the oracle DB extension must not support unbuffered queries, and Flourish is emulating them, or there is a bug in fDatabase.

I would considering breaking the query into queries in a loop where you only fetch maybe 10k at a time using LIMIT and OFFSET.

posted by wbond 8 years ago

Hi Will,

Thats what i did in the end as it was the only way to get around the problem... not sure why it was been exhausted but its certainly a viable workaround for now.


posted by darren 8 years ago