According to the task description each message has it's own 2048 bytes buffer. It is cleaned every new second. You  should check buffer size before store the message and make calculations.