use millis for timestamp
fix unbounded memory usage