Note that there are some explanatory texts on larger screens.

plurals
  1. POSymfony2 Doctrine2 exceeding memory limit, Allowed memory size of 1073741824 bytes exhausted
    text
    copied!<p>I have a relational database for posts. </p> <p>Post Table &lt;-- OneToMany</p> <p>Post cat Table &lt;-- ManyToOne</p> <p>Category Table &lt;-- OneToMany</p> <p>If I use the Doctrine @ORM to join the tables, in Entities using annotation. I get a white screen and in the error logs show the error:</p> <pre><code>emergency.EMERGENCY: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 1052508160 bytes) {"type":1,"file":"/[PATH TO SYMFONY]/vendor/twig/twig/lib/Twig/Extension/Debug.php","line":66} </code></pre> <p>I have upped the memory limit several times, from 64M to 1024M.</p> <p>Has anyone else found this problem? I think that a file executing > a Gig of memory is no good.</p> <p>If I write the query using the query builder I get the results I expect. I think if I could get the Doctrine relational mapping to work this would be better. does any one have an opinion on this? </p> <p>I would love a bit of advice on this matter.</p> <p>Thanks In advance.</p> <p>Joe</p> <p>------------ Edit in response to comment ---------------------------------------</p> <p>Thanks for your comment @Cerad. There are only about 10 rows in the database. Also i'm in app_dev.php. Here are some excerpts form my files.</p> <p>post table</p> <pre><code>class Post { //... ^ table collumns /** * @ORM\OneToMany(targetEntity="PostCats", mappedBy="Post") */ protected $PostCats; public function __construct() { $this-&gt;PostCats = new ArrayCollection(); } } </code></pre> <p>post cat joining table.</p> <pre><code>class PostCats { //... ^ table collumns /** * @ORM\ManyToOne(targetEntity="Post", inversedBy="PostCats") * @ORM\JoinColumn(name="postid", referencedColumnName="id") */ protected $Post; } </code></pre> <p>the controller</p> <pre><code>$posts = $this-&gt;getDoctrine() -&gt;getRepository('comPostBundle:Post') -&gt;find(7); if (!$posts) { throw $this-&gt;createNotFoundException( 'No product found for id '.$posts ); } return new Response(print_r($posts)) </code></pre> <p>Result.... White screen... I have also tried returning the results dumped into a twig template.</p> <p>Do you think its ok to skip the Doctrine relational mapping and just write joins in the entity repositories?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload