Bonjour,

Voila je rencontre un petit problème avec Heroku

Ce que je veux

Je cherche à ce que le robot ne se déconnecte plus au bout de 5 minutes :/

Ce que j'obtiens

Il se déconnecte peu après avec cette erreur :

2020-01-18T17:25:25.327975+00:00 heroku[worker.1]: State changed from up to crashed
2020-01-18T17:25:25.309328+00:00 heroku[worker.1]: Process exited with status 134
2020-01-18T17:25:25.205585+00:00 app[worker.1]: 
2020-01-18T17:25:25.205600+00:00 app[worker.1]: <--- Last few GCs --->
2020-01-18T17:25:25.205603+00:00 app[worker.1]: re[4:0x4407890]   117861 ms: Mark-sweep 256.1 (257.4) -> 255.3 (257.6) MB, 481.9 / 0.0 ms  (+ 0.2 ms in 16 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 498 ms) (average mu = 0.096, current mu = 0.033) allocation failure[4:0x4407890]   118319 ms: Mark-sweep 256.4 (257.6) -> 255.7 (257.9) MB, 282.8 / 0.0 ms  (+ 139.5 ms in 18 steps since start of marking, biggest step 42.7 ms, walltime since start of marking 458 ms) (average mu = 0.086, current mu = 0.078) allocation fail
2020-01-18T17:25:25.205604+00:00 app[worker.1]: 
2020-01-18T17:25:25.205605+00:00 app[worker.1]: <--- JS stacktrace --->
2020-01-18T17:25:25.205607+00:00 app[worker.1]: 
2020-01-18T17:25:25.205609+00:00 app[worker.1]: ==== JS stack trace =========================================
2020-01-18T17:25:25.205610+00:00 app[worker.1]: 
2020-01-18T17:25:25.205612+00:00 app[worker.1]:     0: ExitFrame [pc: 0x1376259]
2020-01-18T17:25:25.205613+00:00 app[worker.1]: Security context: 0x26ced91abb11 <JSObject>
2020-01-18T17:25:25.205619+00:00 app[worker.1]:     1: /* anonymous */ [0x203e558c5ab9] [/app/events/ready.js:~22] [pc=0x2820869a2eda](this=0x203e558c0d51 <Timeout map = 0x1ed1641b84c1>)
2020-01-18T17:25:25.205629+00:00 app[worker.1]:     2: listOnTimeout(aka listOnTimeout) [0xa796a6edce1] [internal/timers.js:~480] [pc=0x2820869ab0d0](this=0x0719e43404a9 <undefined>,0x0f6328986979 <TimersList map = 0x1ed1641b8791>,118010)
2020-01-18T17:25:25.205631+00:00 app[worker.1]:     3: processTimers [0xe1ddeac6e1]...
2020-01-18T17:25:25.205632+00:00 app[worker.1]: 
2020-01-18T17:25:25.205634+00:00 app[worker.1]: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
2020-01-18T17:25:25.205723+00:00 app[worker.1]: 
2020-01-18T17:25:25.215922+00:00 app[worker.1]: Writing Node.js report to file: report.20200118.172525.4.0.001.json
2020-01-18T17:25:25.215929+00:00 app[worker.1]: Node.js report completed
2020-01-18T17:25:25.216396+00:00 app[worker.1]:  1: 0x9dab70 node::Abort() [node]
2020-01-18T17:25:25.216842+00:00 app[worker.1]:  2: 0x9dbd26 node::OnFatalError(char const*, char const*) [node]
2020-01-18T17:25:25.217306+00:00 app[worker.1]:  3: 0xb3b18e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
2020-01-18T17:25:25.217773+00:00 app[worker.1]:  4: 0xb3b509 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
2020-01-18T17:25:25.218332+00:00 app[worker.1]:  5: 0xce68a5  [node]
2020-01-18T17:25:25.218863+00:00 app[worker.1]:  6: 0xce6f36 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
2020-01-18T17:25:25.219393+00:00 app[worker.1]:  7: 0xcf2dca v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
2020-01-18T17:25:25.219923+00:00 app[worker.1]:  8: 0xcf3cd5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
2020-01-18T17:25:25.220467+00:00 app[worker.1]:  9: 0xcf66e8 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
2020-01-18T17:25:25.220982+00:00 app[worker.1]: 10: 0xcbd017 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType) [node]
2020-01-18T17:25:25.221626+00:00 app[worker.1]: 11: 0xff31d9 v8::internal::Runtime_AllocateInOldGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
2020-01-18T17:25:25.222339+00:00 app[worker.1]: 12: 0x1376259  [node]

Comment changer cela ? merci d'avance pour votre aide :D

1 réponse


Apparemment le souci vient de la FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory ça veut dire que tu surcharges la mémoire à dispo pour ton app sur ton instance heroku. Il y a fort à parier que tu as une boucle while ou une itération foireuse qui fou en l'air l'app.