Closed ilukac closed 4 years ago
Ping @dborsatto :)
Hey @ilukac
I don't work for Contentful any more, and I'm not sure how they handle support requests like this one. I suggest you get in touch by pinging them on Twitter or open a support request through the official channel. I'm not sure they have someone actively looking after the PHP repos, so it'd be best to try to get in touch with them somewhere else.
Cheers 🙂
Good to know, thanks!
Hi @ilukac , I am the maintainer of the library now. This does not seem to reproduce in any case, see below for a small example that shows constant memory usage (and pretty low < 3MB):
$data = [ 'nodeType' => 'document', 'content' => [ [ 'nodeType' => 'heading-1', 'content' => [ [ 'nodeType' => 'text', 'value' => 'Heading', 'marks' => [] ] ] ], [ 'nodeType' => 'paragraph', 'content' => [ [ 'nodeType' => 'text', 'value' => 'Foo', 'marks' => [] ] ] ] ] ]; for($i=0;$i<10000;$i++) { $output = $parser->parse($data); echo convert(memory_get_usage())."..."; }
Can you provide a more specific example to put me on the right track?
Good to hear there is someone on the other side :)
I'll retest on my side and let you know if I still have the issue, possible with more details
I think the problem is coming from embedded entry and/or embedded asset. when I removed those then it was ok. Can you retest with embedded entry and/or embedded asset ?
@ilukac we might have run into the same issue that you were experiencing while working on another bug. I think the issue happens iff you have a self-referencing entry in a rich text field. We just released a fix for that, can you upgrade to the latest version of https://github.com/contentful/contentful.php and see if it fixes the issue for you?
On the first try it looks ok. Will reopen if I will have the same issue again. Thanks!
@pgrigoruta I think @ilukac has the same problem as I had here: https://github.com/contentful/contentful.php/issues/278
The trick is to use real API data with hyperlink entries references to resolve. And to disable xdebug extension to reproduce the unlimited memory consumption symptom of the circular dependency bug.
Hi,
I am trying to render a rich text field in my Symfony app. The field really doesn't have much data, just a heading, embedded entry and embedded asset.
When I execute:
$parser->parse($field);
It hits the memory limit of 4G, which is way too much :)
$parser is the Contentful\RichText\Parser $field is the array returned by the dynamic func: Entry->getFieldIdentifier()
Any ideas?