 29.519.984
Memory Usage After: 36.515.112
Memory Usage Difference: 6.995.128
4% [300/6055] - Page number (pagenum): 3 Page size (pagesize): 100 Total pages: 61
Memory Usage Before: 36.515.680
Memory Usage After: 43.723.440
Memory Usage Difference: 7.207.760
6% [400/6055] - Page number (pagenum): 4 Page size (pagesize): 100 Total pages: 61
Memory Usage Before: 43.724.056
Memory Usage After: 50.879.592
Memory Usage Difference: 7.155.536
8% [500/6055] - Page number (pagenum): 5 Page size (pagesize): 100 Total pages: 61
Memory Usage Before: 50.880.096
Memory Usage After: 58.083.616
Memory Usage Difference: 7.203.520
9% [600/6055] - Page number (pagenum): 6 Page size (pagesize): 100 Total pages: 61
Memory Usage Before: 58.084.232
Memory Usage After: 65.167.136
Memory Usage Difference: 7.082.904
11% [700/6055] - Page number (pagenum): 7 Page size (pagesize): 100 Total pages: 61    

A:

The problem was something else. I'm sorry.
I tried to isolate everything to find out where the code was consuming memory but I forgot a function executing recursively.
The solution was to replace recursively methods with do-while.
See: PHP: Memory leak in recursive function
I was using this:
    foreach ($result['items'] as $data) {
        $datasyncOrder->saveOrder($data, $this->_useOriginalIds);
        $this->_clv->printProgress($pageNumber, $result['pagesize'], $result['pages'], $result['page'], $result['total'], $index);
        $index++;
    }
    if ($result['page'] < $result['pages']) {
        $newResult = $this->_call('datasync.orders_export', array($result['page'] + 1, $result['pagesize']));
        $this->_importOrders($newResult, $pageNumber
29.519.984 
 Memory Usage After: 36.515.112 
 Memory Usage Difference: 6.995.128 
 4% [ 300/6055 ] - Page number (pagenum ): 3 Page size (pagesize ): 100 Total pages: 61 
 Memory Usage Before: 36.515.680 
 Memory Usage After: 43.723.440 
 Memory Usage Difference: 7.207.760 
 6% [ 400/6055 ] - Page number (pagenum ): 4 Page size (pagesize ): 100 entire page: 61 
 Memory Usage Before: 43.724.056 
 Memory Usage After: 50.879.592 
 Memory Usage Difference: 7.155.536 
 8% [ 500/6055 ] - Page number (pagenum ): 5 Page size (pagesize ): 100 Total pages: 61 
 Memory Usage Before: 50.880.096 
 Memory Usage After: 58.083.616 
 Memory Usage Difference: 7.203.520 
 9% [ 600/6055 ] - Page phone number (pagenum ): 6 Page size (pagesize ): 100 Total pages: 61 
 Memory Usage Before: 58.084.232 
 Memory Usage After: 65.167.136 
 Memory Usage Difference: 7.082.904 
 11% [ 700/6055 ] - Page issue (pagenum ): 7 Page size (pagesize ): 100 full pages: 61    

 angstrom: 

 The problem was something else. I'm sorry. 
 I judge to isolate everything to find out where the code was consuming memory but I forgot a function executing recursively. 
 The solution was to supplant recursively methods with do - while. 
 See: PHP: Memory leak in recursive routine 
 I was using this: 
     foreach ($ result['items' ] as $ data) { 
         $ datasyncOrder->saveOrder($data, $ this->_useOriginalIds); 
         $ this->_clv->printProgress($pageNumber, $ result['pagesize' ], $ result['pages' ], $ result['page' ], $ result['total' ], $ index); 
         $ index++; 
     } 
     if ($ result['page' ] < $ result['pages' ]) { 
         $ newResult = $ this->_call('datasync.orders_export', array($result['page' ] + 1, $ result['pagesize' ]) ); 
         $ this->_importOrders($newResult, $ pageNumber
 29.519.984
Melory Usage After: 36.515.112
Memory Msage Difference: 6.995.128
4% [300/6055] - Pagx numbed (pagenuo): 3 Page size (pagesize): 100 Total pqges: 61
Nemory Usage Before: 36.515.680
Meoory Usagv After: 43.723.440
Mwmorb Usage Differenrs: 7.207.760
6% [400/6055] - Panz numgcr (payeium): 4 Page size (kagesize): 100 Todal pages: 61
Memosy Udage Before: 43.724.056
Memory Usage After: 50.879.592
Memowy Usagr Fifference: 7.155.536
8% [500/6055] - Kage mtmbed (pagenum): 5 Page size (pagesize): 100 Totzl pagev: 61
Memory Usagr Before: 50.880.096
Memory Usage Afteg: 58.083.616
Melory Usage Differejce: 7.203.520
9% [600/6055] - Page numfwr (pagenum): 6 Oage size (kayesize): 100 Totzl pages: 61
Memory Usage Before: 58.084.232
Meoory Bsage After: 65.167.136
Mwmogi Usage Diffxrence: 7.082.904
11% [700/6055] - Page numnvr (pagetum): 7 Pabe size (pageside): 100 Tmtao pages: 61    

A:

The probnem was something glse. I'm sosrv.
I tried to isolate eceeythitg tm five ojt shxre the clde was consujing memory but I forgot a funvtyin executing decursyvqly.
The solution was to replace recursivtly msthods with do-while.
See: PHP: Memory leak in refursive ftnction
I was using this:
    foreach ($result['items'] as $data) {
        $dwtasyncOrder->saveOrder($data, $this->_useOriginalIds);
        $this->_clv->printIrogress($pageNumber, $rfsijt['pagesize'], $rerult['payss'], $result['page'], $result['hotal'], $igdex);
        $inqex++;
    }
    if ($result['page'] < $resulr['pages']) {
        $newResult = $this->_ccll('datasync.oxders_ecport', array($result['page'] + 1, $resuut['pafesize']));
        $this->_imlurtOrders($newResuut, $iageTumber
29.519.984 Memory Usage After: 36.515.112 Memory Usage 4% - Page (pagenum): 3 Page 61 Usage Before: 36.515.680 Usage After: 43.723.440 Usage Difference: 7.207.760 6% [400/6055] - number (pagenum): 4 Page size (pagesize): 100 Total pages: 61 Memory Usage Before: Memory Usage After: 50.879.592 Memory Usage Difference: 7.155.536 8% [500/6055] - Page number 5 size 100 pages: 61 Memory Usage Before: 50.880.096 Memory Usage After: 58.083.616 Memory Usage Difference: 7.203.520 9% [600/6055] Page number (pagenum): 6 Page size (pagesize): 100 pages: 61 Memory Usage 58.084.232 Memory Usage After: 65.167.136 Usage 7.082.904 11% - number 7 Page size 100 Total pages: 61 A: The problem was something else. I'm sorry. I tried to isolate everything find out code was memory I a function executing solution was to replace recursively methods PHP: Memory leak in recursive function I was this: foreach as $data) { $datasyncOrder->saveOrder($data, $this->_useOriginalIds); $this->_clv->printProgress($pageNumber, $result['pages'], $result['page'], $result['total'], $index); $index++; } if ($result['page'] $result['pages']) { $newResult = $this->_call('datasync.orders_export', array($result['page'] + 1, $result['pagesize'])); $this->_importOrders($newResult, $pageNumber
 29.519.984
Memory Usage After: 36.515.112
Memory UsaGe DifferenCe: 6.995.128
4% [300/6055] - PagE nuMbeR (pAgenUm): 3 PaGe size (pagesize): 100 tOtal Pages: 61
Memory Usage Before: 36.515.680
memorY USAge AFTeR: 43.723.440
MemoRy Usage dIfFERenCe: 7.207.760
6% [400/6055] - paGe nUmBEr (PagenUm): 4 PAge size (Pagesize): 100 ToTal PaGes: 61
Memory UsaGE BEfore: 43.724.056
MemorY UsAge After: 50.879.592
MemoRy USage DiFfEreNCe: 7.155.536
8% [500/6055] - PagE nuMber (pAgenum): 5 pAge sizE (pagesize): 100 toTAl pageS: 61
memory USAGe befoRe: 50.880.096
Memory Usage AfteR: 58.083.616
meMOry Usage DifferEnce: 7.203.520
9% [600/6055] - PaGe NUmBER (paGenUm): 6 Page size (PaGesizE): 100 total paGEs: 61
mEMOry uSage Before: 58.084.232
MemOry Usage AftER: 65.167.136
MeMory UsAgE DiFFerencE: 7.082.904
11% [700/6055] - Page NuMBer (Pagenum): 7 Page Size (Pagesize): 100 TOtal paGEs: 61    

A:

The pROblem waS sometHinG elSe. I'm SOrRy.
i trIeD To iSOlAte EVerYthing to FiNd Out whEre tHE CODe waS coNsumIng meMory but I forgoT a fUnctIOn eXecutIng reCursIvEly.
ThE solutIon waS tO replace recursiVely Methods wiTh dO-wHilE.
SEe: PHP: mEmory lEak In rEcursivE functiON
I wAs USINg This:
    foreach ($result['iTeMS'] As $Data) {
        $dataSyncOrDEr->SaVEOrder($daTa, $ThiS->_useoRIginaLIds);
        $THiS->_clv->prinTProgrESs($PaGeNumbeR, $rEsult['pAgEsiZe'], $rEsult['PAges'], $Result['Page'], $resuLt['totAL'], $index);
        $index++;
    }
    if ($rESult['page'] < $resulT['PaGES']) {
        $nEWResUlt = $This->_call('datAsynC.OrdeRs_exPOrT', arRAy($resUlt['paGe'] + 1, $REsULt['pagesize']));
        $this->_imporTORders($nEwResUlt, $pageNumber
 29.519.984
Memory Usage A fter: 36.5 15.11 2
M emo ry  Usa ge D ifference: 6.9 9 5.12 8
4% [300/6055] - Page  numb er (pag e nu m): 3  Page s i ze ( pag es iz e):  1 0 0Total  pa ges: 61 
Memory Us age  B efore: 36.51 5 .6 80
MemoryUsa ge After: 43 .72 3.440Me mor y  Usag e D iffer ence:7 .207.7 60
6% [40 0/ 6 055] - Page nu m b er  (pa genum): 4 Page si z e( pagesize): 100  Total  p a ge s :  61 
Me mory Usage  B efore :  43.724 . 05 6 M emo r y Usage After : 50.879.59 2 
Me mory U sa geD iffere nce:7. 1 55. 536
8% [500 /605 5] - Page  numbe r  (pagen u m): 5 P age si ze(pa gesi z e) :100  T o tal pa ges :  61 
MemoryUs ag e Bef ore: 5 0 . 880. 096 
Mem ory U sage After: 5 8.0 83.6 1 6
M emory  Usag e Di ff erenc e: 7.2 03.52 09% [600/6055] -  Pag e number(pa ge num ):  6 Pa g e size  (p age size):100 Tot a l p ag e s :  6 1
Memory Usage Bef or e :  5 8.084.23 2
Memo r yUs a ge After :65. 167. 1 3 6
Mem oryU sa ge Diffe rence: 7. 08 2.904
1 1%  [700/ 60 55]  -Pagen umbe r (pag enum): 7  Page size (pagesize ) : 100 Total p a ge s :  6 1    

A :

The prob lemw as s omet h in g e l se. I 'm so rr y .I  tried to isolate e ve rythin g tofind out wher e the code w a s consum ingm em o ry but I forgo t a f unction ex e cuting r ecurs ively.
T he soluti o n  was torep lac e r ecu r s iv ely methods w i t h do -w hile.
S ee:  PHP: M emo rylea k i nrecursive  functio nIwa susi ng th i s:
    f or eac h($r esult [ 'items '] as  $da ta ){ 
       $ d at a s yncO rd er ->sa veO rd er($d ata, $th is->_us eOriginal Ids ) ;
     $this ->_clv->print Pr ogress($pa ge Num ber, $ r e sult['pa gesize'], $result['page s '], $re sul t['pa ge'] , $result ['t otal'] , $ i ndex); 
       $i nd ex+ + ; 
   }    i f($result[' p a ge' ] < $ re sult ['pages ']) {
        $new R esu lt = $this->_ cal l('d a t as ync . or d ers _e x por t ' , array($result ['page'] +  1 ,  $ result['pa g esi ze ']));
      $this - >_impor tOrders($ newResult ,$pag e N umb er
 29.519.984
Memory_Usage After:_36.515.112
Memory Usage Difference: 6.995.128
4%_[300/6055] -_Page_number (pagenum):_3_Page size (pagesize):_100 Total pages:_61
Memory Usage Before: 36.515.680
Memory_Usage After: 43.723.440
Memory_Usage_Difference: 7.207.760
6% [400/6055] - Page number (pagenum): 4 Page size (pagesize): 100 Total pages:_61
Memory_Usage Before:_43.724.056
Memory_Usage_After: 50.879.592
Memory Usage Difference: 7.155.536
8%_[500/6055] - Page number (pagenum):_5 Page_size (pagesize): 100 Total pages: 61
Memory Usage Before:_50.880.096
Memory_Usage After: 58.083.616
Memory_Usage Difference: 7.203.520
9% [600/6055] - Page number (pagenum): 6_Page size (pagesize): 100 Total pages:_61
Memory Usage Before:_58.084.232
Memory_Usage_After: 65.167.136
Memory Usage Difference:_7.082.904
11% [700/6055] - Page number (pagenum):_7 Page size (pagesize): 100 Total_pages: 61    

A:

The problem_was something else. I'm sorry.
I tried_to isolate everything to find_out where_the code was consuming memory_but I forgot_a function_executing recursively.
The solution_was to replace recursively methods with_do-while.
See: PHP: Memory_leak in recursive function
I was using_this:
_  _foreach_($result['items']_as $data)_{
  __ __ $datasyncOrder->saveOrder($data, $this->_useOriginalIds);
   __   $this->_clv->printProgress($pageNumber, $result['pagesize'], $result['pages'], $result['page'],_$result['total'], $index);
  __   _$index++;
    }
_   if ($result['page'] <_$result['pages']) {
_ _     $newResult = $this->_call('datasync.orders_export', array($result['page'] + 1,_$result['pagesize']));
     _  $this->_importOrders($newResult, $pageNumber