Skip to content

Draft: Clear container_dict and context after used

What does this merge request do and why?

The context_dict and/or starlette context might be causing a memory leak by storing long fields as content_below_cursor or prompt_prefix. This MR explicitly clears these objects after logging, so that it might reduce the memory usage.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.

Relates to #375

Merge request reports