# Limit how long streamview keeps events

Use the keep option to delete old events, so that the memory and the SQLite file do not become larger with time.

Source: https://www.eventcatalog.dev/tools/streamview/docs/how-to/limit-kept-events

Without `--keep`, the server never deletes events.
The memory, the SQLite file, and the memory of each open page become larger with time.

## Keep only the newest events

Add `--keep` with a number of seconds. streamview deletes events that are older, by event time.

```
streamview kafka --brokers localhost:9092 --keep 86400
```

This command keeps the events of the last 24 hours.

`--keep` works with `demo`, `kafka`, `nats`, and `serve`.

## What you see when streamview deletes events

streamview does not delete events continuously. It deletes them at intervals.
The interval is one quarter of the `--keep` value, but not less than 10 seconds and not more than 15 minutes.

When streamview deletes old events, each open page loads the events again.
The selected event closes.

## Read less history at the start

`--keep` does not stop the adapter from reading old messages. streamview reads them, and then deletes them.
To read only new messages, add `--latest`.

## Related

- [Command line](https://www.eventcatalog.dev/tools/streamview/docs/reference/command-line)
- [Limits](https://www.eventcatalog.dev/tools/streamview/docs/reference/limits)
