mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 19:38:46 -05:00
[GH-ISSUE #23067] feat: Reduce message batch size & unload off-screen messages to prevent memory bloat and UI freezing #35408
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ShirasawaSama on GitHub (Mar 26, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23067
Check Existing Issues
Verify Feature Scope
Problem Description
Yes. Currently, Open WebUI loads 20 messages per batch in a chat. For conversations with rich content (code blocks, LaTeX, images, long markdown), this leads to:
This makes long conversations practically unusable on phones and even sluggish on desktops.
Desired Solution you'd like
Two changes:
1. Reduce the initial/incremental message load count
2. Unload (unmount) off-screen messages when the user sends a new message
Alternatives Considered
Why not Virtual Scrolling?
Traditional virtual scrolling (like
react-windowortanstack-virtual) is designed for uniform, scrollable lists. Chat messages have variable and unpredictable heights (especially with streaming, code blocks, and markdown rendering), making true virtual scrolling complex to implement correctly.The proposed approach is simpler and more practical:
Additional Context
Yes. Currently, Open WebUI loads 20 messages per batch in a chat. For conversations with rich content (code blocks, LaTeX, images, long markdown), this leads to:
This makes long conversations practically unusable on phones and even sluggish on desktops.
@ShirasawaSama commented on GitHub (Mar 29, 2026):
I recommend keeping at least 3 elements outside the screen when offload.
@Classic298 commented on GitHub (Mar 29, 2026):
you recommend loading 4 message pairs - depending on screen size, that might only fit like half of the screen. what if we load 8?
how do you track which oones are outside of the screen? but yeah 3 outside the screen make sense
@ShirasawaSama commented on GitHub (Mar 29, 2026):
"4" is the default value set in our production environment, and it has been in place for over six months. Of course, I think making this configurable is also an option.
Reason: Four messages are sufficient for display on most screens we’ve tested (such as desktop monitors, laptops, and mobile devices); we maintain an internal test list that includes a wide variety of devices.
If the messages doesn't fill the entire screen, it will now load automatically. This not a problem.
@Classic298 commented on GitHub (Mar 29, 2026):
ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
yes then make it 4
@Classic298 commented on GitHub (Mar 29, 2026):
much in favor of this - configurability not inherently needed i think
@Classic298 commented on GitHub (Apr 13, 2026):
026903399b@frost19k commented on GitHub (Apr 21, 2026):
Scrolling up is jumping all over the place now in 0.9.1
It's a real challenge to make the page land where you want it to when scrolling up.
Work around is scroll up passed where you want to land then scroll down.