mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-08 00:30:03 -04:00
36c416ff4e
# Description of Changes While testing #4663, I discovered the server would crash from a V8 out of memory error after processing many requests. Before #4663, this would not happen. I theorized that because we now have a single JS worker that can process an unbounded number of reducer calls over its lifetime, any V8 heap retention that would previously have been spread across several pooled isolates now accumulates in one isolate. This patch now periodically collects heap statistics and forces GC or replaces the isolate if memory cannot be reclaimed. This greatly reduces the risk of hitting the V8 heap limit and crashing the server. It doesn't remove the risk entirely however. But this risk was still present before we switched to a single worker model in #4663. In order to remove the risk of crashing the server entirely, we would need to run V8 in a separate process. # API and ABI breaking changes None # Expected complexity level and risk 3 # Testing TBD
⚠️ Internal Crate ⚠️
This crate is intended for internal use only. It is not stable and may change without notice.