asciinema / asciicast2gif

Generate GIF animations from asciicasts (asciinema recordings)
MIT License
1.2k stars 83 forks source link

Fails with large cast file #63

Closed goodevilgenius closed 2 years ago

goodevilgenius commented 5 years ago

When the cast file is very large, asciicast2gif fails during the loading stage. The following output is given:

==> Loading bonsai.cast...

<--- Last few GCs --->

[12082:0x34e5b10]    18363 ms: Scavenge 1394.0 (1421.5) -> 1393.4 (1422.0) MB, 4.9 / 0.0 ms  (average mu = 0.148, current mu = 0.091) allocation failure
[12082:0x34e5b10]    18374 ms: Scavenge 1394.2 (1422.0) -> 1393.6 (1423.0) MB, 8.5 / 0.0 ms  (average mu = 0.148, current mu = 0.091) allocation failure
[12082:0x34e5b10]    18381 ms: Scavenge 1394.4 (1423.0) -> 1393.8 (1423.5) MB, 5.0 / 0.0 ms  (average mu = 0.148, current mu = 0.091) allocation failure

<--- JS stacktrace --->

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

    0: ExitFrame [pc: 0x35945554fb5d]
Security context: 0x08897de9d921 <JSObject>
    1: /* anonymous */ [0x2422dc3263d9] [/home/drj/.nvm/versions/node/v11.6.0/lib/node_modules/asciicast2gif/main.js:~183] [pc=0x35945556c1c9](this=0x00eaab6aea39 <x map = 0x7f587cd3381>)
    2: /* anonymous */ [0x2422dc33c999] [/home/drj/.nvm/versions/node/v11.6.0/lib/node_modules/asciicast2gif/main.js:~455] [pc=0x35945586fbd3](this=0x163834a1d709 <JSFuncti...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x948d20 node::Abort() [node]
 2: 0x9499bc node::OnFatalError(char const*, char const*) [node]
 3: 0xb1160e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb11844 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xf0def2  [node]
 6: 0xf0dff8 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [node]
 7: 0xf1a718 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xf1b22b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xf1df61 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [node]
10: 0xee8194 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [node]
11: 0x119db7e v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [node]
12: 0x35945554fb5d

This is using this 90MB file: https://fil.email/0YF33fY0

These results were running natively (not under docker) on an Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz with 40GB of RAM

ku1ik commented 2 years ago

I suggest to try https://github.com/asciinema/agg instead, which is a successor to asciicast2gif. It handles recordings of any size with no sweat, so it should have no problem with generating gif from you large asciicast files. I can't verify on your file since the link expired, but I tested today on another large file (80MB) and it created gif file just fine (although the gif was over 200 MB in size).