Hi folks,
several times I ran into the same issue with continuously
increasing
memory consumtion if I loop a huge list of e g. article ids
like this:
foreach ( $aOXIDs as $sOxid ) {
$oArticle = oxNew('oxarticle');
$oArticle->load($sOxid);
....
}
even if I try to clone an object it will have just a tiny
effect:
$oBaseArticle = oxNew('oxarticle');
foreach ( $aOXIDs as $sOxid ) {
$oArticle = clone $oBaseArticle;
$oArticle->load( $sOxid );
....
}
unsetting the object is useless in both cases and has no
effect on
memory consumption.
I expect the problem in the factory triggering, so unsetting
the last
instance is just useless. Is there really no counterpart for
oxNew() or
load-Method for cleaning up the memory before going to next
step in the
above loop.
Am I the only one who's running into that problem? And no,
articlelists
are not the solution for dealing with tenthousands of
products.
The only thing I currently can do is NOT to use the oxid
objectframework
in cases like this and therefore directly query the database.
Not
elegant, but it guarantees a near flat memory consumption.
What about your best practices on the issue above if you need
full
variant informations? Would you agree having some kind of
memory
cleaning method inside the oxid framework?
Best wishes
André