News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Chris Jones' Blog:
Reducing Oracle LOB Memory Use in PHP, or Paul's Lesson Applied to Oracle
March 22, 2010 @ 13:49:51

Following along the same theme of Paul Reinheimer's suggestion of using unset to conserve memory usage, Chris Jones has applied a similar pattern to the world of Oracle+PHP.

In Oracle you might come across this situation when dealing with LOBS. Here's an example that selects an entire LOB into PHP's memory. I see this being done all the time, not that that is an excuse to code in this style. The alternative is to remove OCI_RETURN_LOBS to return a LOB locator which can be accessed chunkwise with LOB->read().

He includes an example of pulling out some large data from a table's CLOB fields showing some stats on the memory usage, both with and without an unset to handle the growing fetched data. The end result was a much lower memory usage overall (peak) and a mention of two other things that could help with the Oracle side of things - LOB->free() and the latest OCI8 extension that frees up LOB resources more efficiently.

2 comments voice your opinion now!
memory usage optimize oracle lob benchmark


blog comments powered by Disqus

Similar Posts

php|architect: Stop Telling People to Optimize, and Start Teaching Them to Program

Christopher Jones' Blog: Customer Interview on PHP & Oracle 11g Connection Pooling (DRCP) in Oracle

Symfony Blog: Is symfony too slow for real-world usage?

Zend Developer Zone: Zend Releases Zend Platform 2.2 and Zend Core for Oracle

Tiffany Brown's Blog: PHP quickie: is_numeric() versus ctype_digit()


Community Events











Don't see your event here?
Let us know!


hack install example composer unittest security overview application component hhvm symfony2 framework language opinion facebook podcast code package release introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework