eZ Community » Forums » eZ Publish 5 Platform » Allowed memory size exhausted
expandshrink

Allowed memory size exhausted

Allowed memory size exhausted

Friday 26 September 2014 3:22:27 pm - 4 replies

Hi,
I have an application ez5/ez4 which displays videos. On my dev machine (windows) everything was fine.
On my prod server (Debian7, php 5.4, ezp5 - 2014.07) whenever I try to open a page including a large video, I get this memory issue which happen in
ezpublish_legacy/kernel/classes/clusterfilehandlers/ezfsfilehandler.php on line  on line 229.
which (obviously) is trying to read the video file... suspicious.gif Emoticon

(here is the whole trace )

I do not know neither why this clusterfile handler method is triggered, since I do not use cluster.

I copied my whole production ezp folder, on my dev machine in order to see if there is any setting issue. But on my dev machine everything is fine.

I tried to debug with a breakpoint on that line on my debug machine, but it never goes through this function.

The page on which I am having trouble is built with symfony pagelayout and the content is issued from ez4 (tpl file). In my tpl, I even tried to remove what was related to the video file URL (only displaying the title) but the problem is still there.

And last thing I tried is to change my setting legacy=true and here everything is working fine...

Do you have any idea about what the problem could be and how to fix it ?

Thanks for your help,
Hakim

Sorry, I was not able to use the Gists tag, so here is the link

Modified on Friday 26 September 2014 4:04:30 pm by Hakim Bouras

Friday 26 September 2014 4:50:20 pm

Just for info, if I try to open a page with a small Video I do not have the memory issue and the page displayed as expected.

Hakim

Saturday 27 September 2014 11:02:31 am

For whom it may help,

In fact, I had the same problem in both prod and dev server (my memory setting in the dev environnement was a lot higher, that was why I did not hit the problem before).

So after debugging, the problem is because of the ez5 contentService->loadContent() method which try to load each content attribute, and when loading the file attribute in

\eZ\Publish\Core\FieldType\BinaryBase\BinaryBaseStorage::getFieldData()

it will call :

\eZ\Publish\Core\IO\Handler\Legacy::load()

in which it may define the mime type if it is using DB based ClusterFileHandlers (not with FS ones), and if the mimetype is not defined then a further method :

\eZ\Publish\Core\IO\Handler\Legacy::load()

will just load the file in memory to define its mime type : which a real issue when you have big files...

More the less, even with smaller files (of some megabytes), that do not hit the memory limit, it may probably have an impact on performances.

Hakim

Modified on Saturday 27 September 2014 11:04:59 am by Hakim Bouras

Sunday 28 September 2014 11:20:28 pm

Indeed.

 

Reported it here: https://jira.ez.no/browse/EZP-23390

Possible fix, please test: https://gist.github.com/andrerom/17053187dbfea0a89806

Monday 29 September 2014 12:39:51 pm

Your fix is working so far.

Thanks André,

Hakim

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from