How to free the memory of Task& a=*new(task::allocate_root()) P2MainTask(&Improve)?
<p>I originally built my TBB code on Windows and it worked fine. Today I moved my code to Linux system (OpenSUSE 64 bit).</p>

<p>When I tried to run it, the program always stopped after some iterations. I wonder whether it is because the system run out of memory.The part of code is put below.</p>

<pre><code>SolverP2 Improve(&amp;inst,&amp;mysolution,StartSolT1,&amp;P1Queue,&amp;P2Queue,&amp;P3Queue,iterControl,exchangeControl,&amp;stopControl );
        task_list tl;  
    P2MainTask&amp; a=*new(task::allocate_root()) P2MainTask(&amp;Improve);
     tl.push_back(a);
        SolverP2T2 Thread2(&amp;inst,&amp;mysolution,StartSolT2,&amp;P1Queue,&amp;P2Queue,iterControl,exchangeControl,&amp;stopControl );
    P2Thread2Task&amp; b=*new(task::allocate_root()) P2Thread2Task(&amp;Thread2);
       tl.push_back(b);
    SolverP2T3 Thread3(&amp;inst,&amp;mysolution,StartSolT3,&amp;P1Queue,&amp;P3Queue,iterControl,exchangeControl,&amp;stopControl );
    P2Thread3Task&amp; c=*new(task::allocate_root()) P2Thread3Task(&amp;Thread3);
      tl.push_back(c);
       Shaking shakeSol(&amp;inst,&amp;mysolution,StartSolT4,&amp;P4Queue,&amp;stopControl );
       ShakingTask&amp; d=*new(task::allocate_root()) ShakingTask(&amp;shakeSol);
       tl.push_back(d);
        cout&lt;&lt;"task deine finished"&lt;&lt;endl;       
       task::spawn_root_and_wait(tl);
         cout&lt;&lt;"task start finished"&lt;&lt;endl;  
</code></pre>

<p>Could anyone tell me how to solve this problem? how can we release the memory defined by new for reuse? Thanks!</p>
