I have a piece of code, which has to handle several hundred objects (images), but after the 77th instance it bumps into the 128 MB memory limit and dies.
The objects instaced by a static call which returns a new instance of the object:
foreach($imags as $imageId)
{
$image = IMP::getById($imageId);
...
...
}
The problem is, that after each loop iteration the memory never gets freed, as seen below, each new imageobject eats up helluva lot of memory.
Memory usage:
...
20971520
22282240
23855104
25427968
27000832
28573696
30408704
32243712
34078720
35913728
38010880
39845888
...
Any ideas how can the object memory space be reused?