fraction / oasis

Free, open-source, peer-to-peer social application that helps you follow friends and discover new ones on Secure Scuttlebutt (SSB).
http://oasis-demo.fraction.io
GNU Affero General Public License v3.0
286 stars 42 forks source link

core dump due to too much memory? #607

Open justinabrahms opened 3 years ago

justinabrahms commented 3 years ago

Here's my full log for systemd. I have 1gb of ram, and oasis is consuming 30-50% of it.

Feb 16 04:32:53 octiron systemd[12531]: Started Oasis - Friendly Scuttlebutt Web Interface.
Feb 16 04:32:54 octiron bash[12543]: 2021-02-16T04:32:54.008Z oasis No configuration file found at /home/justin/.config/oasis/default.json, using built-in default values.
Feb 16 04:32:56 octiron bash[12543]: 2021-02-16T04:32:56.044Z oasis Listening on http://hostname:4515
Feb 16 04:32:56 octiron bash[12543]: 2021-02-16T04:32:56.053Z oasis Starting Scuttlebutt service
Feb 16 04:32:56 octiron bash[12543]: ssb-friends: stream legacy api used
Feb 16 04:33:13 octiron bash[12543]: about-name-warmup: 17.397s
Feb 16 04:33:13 octiron bash[12543]: updating 10513 feeds
Feb 16 04:33:17 octiron bash[12543]: process found blob &xWgZ7iggxf3IA75NVkY6t3C0wJCIEzxjyAmZ314W1Qc=.sha256 has size >= blobs.max
Feb 16 04:33:17 octiron bash[12543]: want blob &xWgZ7iggxf3IA75NVkY6t3C0wJCIEzxjyAmZ314W1Qc=.sha256 but size 14382571 >= 10000000 (currently set blobs.max)
Feb 16 04:33:17 octiron bash[12543]: process found blob &xWgZ7iggxf3IA75NVkY6t3C0wJCIEzxjyAmZ314W1Qc=.sha256 has size >= blobs.max
Feb 16 04:33:17 octiron bash[12543]: want blob &xWgZ7iggxf3IA75NVkY6t3C0wJCIEzxjyAmZ314W1Qc=.sha256 but size 14382571 >= 10000000 (currently set blobs.max)
Feb 16 04:33:32 octiron bash[12543]: transpose-name-index: 18.386s
Feb 16 04:36:41 octiron bash[12543]: ssb-friends: get legacy api used
Feb 16 04:38:06 octiron bash[12543]: <--- Last few GCs --->
Feb 16 04:38:06 octiron bash[12543]: [12543:0x4f26110]   311508 ms: Scavenge (reduce) 484.0 (496.6) -> 483.1 (496.6) MB, 1.6 / 0.0 ms  (average mu = 0.129, current mu = 0.034) allocation failure
Feb 16 04:38:06 octiron bash[12543]: [12543:0x4f26110]   311524 ms: Scavenge (reduce) 484.3 (493.6) -> 483.5 (494.6) MB, 2.2 / 0.0 ms  (average mu = 0.129, current mu = 0.034) allocation failure
Feb 16 04:38:06 octiron bash[12543]: [12543:0x4f26110]   311536 ms: Scavenge (reduce) 484.4 (493.6) -> 483.9 (494.8) MB, 3.9 / 0.0 ms  (average mu = 0.129, current mu = 0.034) allocation failure
Feb 16 04:38:06 octiron bash[12543]: <--- JS stacktrace --->
Feb 16 04:38:06 octiron bash[12543]: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Feb 16 04:38:06 octiron bash[12543]:  1: 0xa04200 node::Abort() [node]
Feb 16 04:38:06 octiron bash[12543]:  2: 0x94e4e9 node::FatalError(char const*, char const*) [node]
Feb 16 04:38:06 octiron bash[12543]:  3: 0xb797be v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
Feb 16 04:38:06 octiron bash[12543]:  4: 0xb79b37 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
Feb 16 04:38:06 octiron bash[12543]:  5: 0xd343c5  [node]
Feb 16 04:38:06 octiron bash[12543]:  6: 0xd34f4f  [node]
Feb 16 04:38:06 octiron bash[12543]:  7: 0xd42fdb v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
Feb 16 04:38:06 octiron bash[12543]:  8: 0xd46b9c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAli
Feb 16 04:38:06 octiron bash[12543]:  9: 0xd1527b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
Feb 16 04:38:06 octiron bash[12543]: 10: 0x105b26f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
Feb 16 04:38:06 octiron bash[12543]: 11: 0x1401239  [node]
Feb 16 04:38:14 octiron systemd[12531]: oasis.service: Main process exited, code=dumped, status=6/ABRT
Feb 16 04:38:14 octiron systemd[12531]: oasis.service: Failed with result 'core-dump'.
Feb 16 04:38:14 octiron systemd[12531]: oasis.service: Service hold-off time over, scheduling restart.
Feb 16 04:38:14 octiron systemd[12531]: oasis.service: Scheduled restart job, restart counter is at 1.
Feb 16 04:38:14 octiron systemd[12531]: Stopped Oasis - Friendly Scuttlebutt Web Interface.
Feb 16 04:38:14 octiron systemd[12531]: Started Oasis - Friendly Scuttlebutt Web Interface.
Feb 16 04:38:14 octiron bash[12705]: 2021-02-16T04:38:14.836Z oasis No configuration file found at /home/justin/.config/oasis/default.json, using built-in default values.
Feb 16 04:38:16 octiron bash[12705]: 2021-02-16T04:38:16.742Z oasis Listening on http://hostname:4515
Feb 16 04:38:16 octiron bash[12705]: 2021-02-16T04:38:16.752Z oasis Starting Scuttlebutt service
Feb 16 04:38:16 octiron bash[12705]: ssb-friends: stream legacy api used
Powersource commented 3 years ago

Is this the same issue as https://github.com/fraction/oasis/issues/445 ? Guessing you have updated since?

Powersource commented 3 years ago

And I think oasis crashing due to wanting more than 500MB of ram is probably to be expected sadly

justinabrahms commented 3 years ago

It is the same problem as the other ticket linked. How can we prevent this from happening? I wouldn't guess that we have individual messages that are 500mb (esp since this is configurable).

On Thu, Feb 18, 2021, at 3:56 AM, Jacob Karlsson wrote:

And I think oasis crashing due to wanting more than 500MB of ram is probably to be expected sadly

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fraction/oasis/issues/607#issuecomment-781292051, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAA6DPEZIQOEJRLRP2BD5LS7T565ANCNFSM4XVYSVGQ.

Powersource commented 3 years ago

No not individual messages, the whole process. Do you just not have enough ram for this app maybe? Or do you mean that this error would only happen if trying to make one big allocation of 500MB+?

Powersource commented 3 years ago

What happens if you add a few GB of swap?

justinabrahms commented 3 years ago

@Powersource This was with 2gb of swap.

justinabrahms commented 3 years ago

Per %DjMkwoTKNY2N/kjrOhhX8tHiKhtknwcHZoiDrjEerio=.sha256, this seems to have abated. I'll use the tool for a bit to see how it goes.

I have 2gb of swap on that machine.