The goal of this ticket is to investigate with XHProf profiler, and find the cause of these memory issues and fix them.
Archiving memory required before investigation started: 8Gb.
Memory after the ticket is implemented: 1Gb.
THE POWER OF BETTER CODE. NO LEAK.
Call Table\Manager::deleteAll() for both Days and Periods, not only for Periods
should use less memory when aggregating data table records in https://github.com/piwik/piwik/commit/dc2d18d7192dd70ed54ccba69ea10415c612246e