One way to optimize your query is to not use the doSelect method on a Propel
model class but rather the doSelectRS method. doSelect in effect does a
SELECT * on your database whereas with a doSelectRS you can specify exactly
only those columns you want returned and it is returned in a non-hydrated
fashion.

Of course thats Propel1.2. If you are using Propel 1.3 then instead of
doSelectRS you would need to use a doSelectStmt. The syntax of each is
different but they are essentially the same thing, returning a resultset to
you instead of an array of hydrated objects, with only the exact columns you
want and therefore is far more memory efficient.

eg:

$c = new Criteria();
$c->clearSelectColumns();
$c->addSelectColumns(MyModelPeer::COLUMN_NAME);
$results = MyModelPeer::doSelectRS($c);

Gareth

On Fri, Apr 3, 2009 at 10:45 AM, Lee Bolding <[email protected]> wrote:

>
> That's 50MB, which seems more than enough to me - typically, my max
> ram is set to 32MB.
>
> The error would suggest you are retrieving far too many objects in a
> DB query and/or that they are far too big.
>
> Investigate optimising your query, lazy loading and database
> normalisation
>
> On 3 Apr 2009, at 03:03, xhe wrote:
>
> >
> > I am using shared hosting, but my backend can not be used due to
> > memory inefficiency:
> >
> > Fatal error: Out of memory (allocated 51380224) (tried to allocate
> > 7680 bytes) in /home1/transla1/public_html/symfony-clb/lib/model/om/
> > BaseUserColorEyePeer.php on line 80
> >
> > are there anyway to reduce the memory usage?
> > >
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to