Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server crash when dashboard call with several thousand of entries #208

Closed
llaske opened this issue Jan 9, 2020 · 3 comments
Closed

Server crash when dashboard call with several thousand of entries #208

llaske opened this issue Jan 9, 2020 · 3 comments

Comments

@llaske
Copy link
Owner

llaske commented Jan 9, 2020

When the dashboard is run on a database with several thousand of entries, the graph not drawn and the server crash.

image

On the server side the error is:

<--- Last few GCs --->

[18304:0x3924b60]    41557 ms: Mark-sweep 1347.3 (1456.2) -> 1347.3 (1456.2) MB, 141.8 / 0.0 ms  (average mu = 0.069, current mu = 0.001) allocation failure scavenge might not succeed
[18304:0x3924b60]    41699 ms: Mark-sweep 1347.3 (1456.2) -> 1347.2 (1440.2) MB, 141.6 / 0.0 ms  (average mu = 0.035, current mu = 0.001) last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x0f0dfe69e6e9 <JSObject>
    0: builtin exit frame: stringify(this=0x0f0dfe691a21 <Object map = 0x33024b5042a9>,0x26881e0826f1 <undefined>,0x26881e0826f1 <undefined>,0x379283b16cd1 <JSArray[7640]>,0x0f0dfe691a21 <Object map = 0x33024b5042a9>)

    1: arguments adaptor frame: 1->3
    2: stringify(aka stringify) [0x1097c01e5cb9] [/home/lionel/src/olpc/sugarizer-server/node_modules/express/lib/response.js:~1114] [pc=0x2e0...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x8fa050 node::Abort() [node]
 2: 0x8fa09c  [node]
 3: 0xb0020e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb00444 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xef4952  [node]
 6: 0xef4a58 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
 7: 0xf00b32 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xf01464 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xf02979 v8::internal::Heap::CollectAllAvailableGarbage(v8::internal::GarbageCollectionReason) [node]
10: 0xf0413e v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
11: 0xed3d1b v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [node]
12: 0x1203f60 v8::internal::IncrementalStringBuilder::Extend() [node]
13: 0xfc8141 v8::internal::JsonStringifier::SerializeString(v8::internal::Handle<v8::internal::String>) [node]
14: 0xfc859b v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
15: 0xfcd6ad v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
16: 0xfcabfa v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<true>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
17: 0xfcd6ad v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
18: 0xfcd316 v8::internal::JsonStringifier::Result v8::internal::JsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [node]
19: 0xfce409 v8::internal::JsonStringifier::Stringify(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [node]
20: 0xbd4d31 v8::internal::Builtin_JsonStringify(int, v8::internal::Object**, v8::internal::Isolate*) [node]
21: 0x2e091c8dbf7d 
Abandon (core dumped)
@llaske llaske added the bug label Jan 9, 2020
@im-prakher
Copy link

@llaske due to such huge amount of data, the memory size must have exceeded its limit for the heap in v8. Have a look at this,
heap-size-limit in v8.

By the way, restarting the server with following command to increase the memory for process will solve the issue,
node --max-old-space-size="NEW_MEMORY_SIZE in MB" server.js

For 8GB memory space set memory size to 8192 MB,
node --max-old-space-size=8192 server.js

This will start the server.js with a memory limit of 8 GB.

@llaske
Copy link
Owner Author

llaske commented Jan 14, 2020

@im-prakher thanks for the advice but increasing the memory will not solve the issue when users count will continue to grow.
We should found a more long-term solution.

@llaske
Copy link
Owner Author

llaske commented Jan 14, 2020

Fixed in #212

@llaske llaske added this to the 1.3.0 milestone Oct 7, 2020
@llaske llaske closed this as completed Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants