We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41479
    • 5 Posts
    Hi,

    tried to make some improvements and got:

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 523800 bytes) in /home/XXXX/domains/new.XXXXX.com/public_html/core/xpdo/om/xpdoobject.class.php on line 116

    Can anyone help?

    Revo 2.2.4 - advanced-pl

    salik

    This question has been answered by opengeek. See the first response.

    [ed. note: rethrash last edited this post 13 years, 10 months ago.]
      • 34012
      • 88 Posts
      Most likely you are trying to load too many objects to memory.

      This is just a random guess but if you are using getCollection() as retrieval function for query. It will load all of the objects to you RAM which then again is controlled by PHP memory setting etc...

      Use newQuery() and limit() method from that class to reduce the memory consumption.

      Unfortunately there is no mathematical way to say how many objects you can retrieve as it is in whole really dependant on your database and size of what the retrieved fields has,
        Almost retired from web-development industry but still randomly writing at Lazylegs.info and on schedule hopefully in near future to finish Oracle and PostgreSQL ports of MODX
        • 3749
        • 24,544 Posts
        Using getIterator() instead of getCollection() can reduce the memory load (the args are the same).

        You may also have a circular reference somewhere.

        If this doesn't help, you'll have to tell us more about what you're doing.



        ------------------------------------------------------------------------------------------
        PLEASE, PLEASE specify the version of MODX you are using.
        MODX info for everyone: http://bobsguides.com/modx.html
          Did I help you? Buy me a beer
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/modx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
          • 41479
          • 5 Posts
          Hi, I forgot to write that it happens when I use getResources &resources=`14` &tpl=`content`

          There is only one paragraph in this resource and content is build of *content
            • 16348
            • 64 Posts
            Try to remove the &tpl parameter. That will make getResources output the result as an array listing. In that way, you will see how big your resultset is.
              • 22303 MODX Staff
              • 10,725 Posts
              I hope you are not using the tag:

              [[*content]]


              within your getResources tpl Chunk. That would cause an infinite loop that would process the current pages content within this part of the current pages content...
                • 41479
                • 5 Posts
                yeah I do. so that probably is the cause. what tag should I use +content gives nothing sad
                • discuss.answer
                  • 22303 MODX Staff
                  • 10,725 Posts
                  By default getResources does not select the content of the Resource. This would take extra memory when content is not used, so you need to add the &includeContent=`1` property in the snippet in order to output the content of the Resource.
                    • 41479
                    • 5 Posts
                    thx, that worked just fine smiley