Circular data logging

i want to log data over ad memory circularly . can anyone tell me the complete procedure .

thanks in advance

i have tried to write data on ad memory circularly the procedure is
1 first i partitioned ad memory by using at+wopen=6,1088
2 then i suscribed a cell with undefned size
3 i wrote 1300 strings each of 100 characters
4 after that i finalized the cell and susribed the next cell for undefined size
5 i done this about 4 times . now i have no memry so i have to delete first cell.
now when i am deleting is it necessary to recompact it