[Bug]: Frequent server crashes/unresponsive -Very High CPU usage, Very High memory usage
What happened?
I am using selfhosted option. Since I have upgraded my server to 0.27.3 from 0.26.4, its crashing intermittently. Server goes in a server load 20 on a 2 vcpu system, Very High CPU usage, Very High memory usage state and the app becomes unresponsive.
Environment: Docker container number of users: 3 number of devices: 7 Total notes across all users: less than 40 (less than 100 mb usage)
Authn: Oauth/OIDC - Keycloak
Error in server logs: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Symptom: Container restarts don't help until done 10-12th times, in one of which is comes up fine and everything works. Then it reaches high CPU/High Memory/very High Server load situation and becomes unresponsive in a couple days.
My Attempts: increased server memory from 4GB ( 0.26.4 version was running fine for months) to 8GB also increasing Java heap size by providing environment variable "NODE_OPTIONS: --max-old-space-size=6144". Server ends up using all increased memory and becomes unresponsive.
Distribution version
Linux
App Version
0.27.3
What browsers are you seeing the problem on if you're using web version?
Chrome
Are you self-hosting?
- Yes
Self-hosting Version
0.27.3
Relevant log output
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
1: 0xe46bbe node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
2: 0x1243740 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
3: 0x1243a17 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
4: 0x1472925 [node]
5: 0x148c1b9 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
6: 0x14608b8 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
7: 0x14617e5 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
8: 0x143a3ee v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
9: 0x189ccfc v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
10: 0x748553e6caf6Anything else?
No response
Is your content generated by AI?
- I confirm that the content I submitted was not generated by AI / merely contained minimal AI edits.
Source: toeverything/AFFiNE