-
-
Notifications
You must be signed in to change notification settings - Fork 24.1k
Chat Messages panel crashes with OOM when database has large volume of messages — no pagination or default limit #6038
Description
Describe the bug
When accessing the Chat Messages panel in the Flowise dashboard, the application crashes with "FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory" if there are a large number of messages within the default 30-day date range.
The panel loads the full 30-day range before the user has any chance to change the date filter. With ~157,000 messages in the database, Node.js attempts to serialize all messages into JSON in memory, consuming 8-12GB of RAM before crashing.
This happens regardless of the database backend — we've tested with both SQLite and PostgreSQL 17. The atabase returns the data quickly; the issue is Node.js trying to hold all messages in memory at once.
Environment:
- Flowise: latest (self-hosted via Docker/Easypanel)
- Database: PostgreSQL 17 (also reproducible with SQLite)
- Messages in database: ~157,000
Error log:
<--- Last few GCs --->
[1:0x7fcef78f2660] Mark-Compact 8036.4 (8238.9) -> 8036.4 (8238.9) MB,
626.75 / 0.00 ms allocation failure; scavenge might not succeed
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
To Reproduce
- Accumulate ~100,000+ chat messages over time
- Navigate to the Chat Messages panel in the dashboard
- The panel automatically loads messages from the last 30 days
- Node.js crashes with heap out of memory before the user can change the date filter
Expected behavior
The Chat Messages panel should either:
- Use server-side pagination with a configurable page size (e.g., 100-500 messages per page) instead of loading all messages at once
- Allow configuration of the default date range via environment variable (e.g., CHATMESSAGE_DEFAULT_DAYS=7)
- Default to a shorter date range (e.g., 7 days) for the initial load, letting the user expand if needed
- Stream/lazy-load messages instead of loading everything into memory at once
Any of these would prevent the OOM crash for users with high message volumes.
Screenshots
No response
Flow
No response
Use Method
Docker
Flowise Version
3.1.0
Operating System
Linux
Browser
Chrome
Additional context
No response