Vue: ERREUR FATALE lors de la construction : compactage inefficace près de la limite de tas Échec de l'allocation

Créé le 13 juin 2019  ·  3Commentaires  ·  Source: vuejs/vue

Version

2.6.10

Lien de reproduction

https://github.com/greenpdx/opencv-vue

Étapes à reproduire

npm i opencv.js

ajouter quelques lignes à main.js

import * as cv from 'opencv.js'
Vue.prototype.$cv = cv

et essayez de construire alors npm run build

Qu'est-ce qui est attendu ?

Building for production...

 DONE  Compiled successfully

Que se passe-t-il réellement ?

⠼  Building for production...

<--- Last few GCs --->

[12278:0x55a446ded250]    48764 ms: Mark-sweep 1336.7 (1441.2) -> 1321.7 (1441.2) MB, 875.5 / 0.0 ms  (average mu = 0.184, current mu = 0.078) allocation failure scavenge might not succeed
[12278:0x55a446ded250]    49725 ms: Mark-sweep 1337.0 (1441.2) -> 1322.0 (1441.7) MB, 892.9 / 0.0 ms  (average mu = 0.130, current mu = 0.071) allocation failure scavenge might not succeed


<--- JS stacktrace --->

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

    0: ExitFrame [pc: 0x13e4d8c4fc5d]
Security context: 0x266f3d81d9f1 <JSObject>
    1: Sn(aka Sn) [0x169ed77ba971] [.../test0/node_modules/terser/dist/bundle.min.js:~1] [pc=0x13e4d93a6153](this=0x1ec95ca825b1 <undefined>,0x1ec95ca825b1 <undefined>)
    2: /* anonymous */(aka /* anonymous */) [0xfa94c311551] [.../test0/node_modules/terser/dist/bundle.min.js:~1] [pc=0x13e4d93c1...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x55a445721761 node::Abort() [/usr/bin/node]
 2: 0x55a445723255 node::OnFatalError(char const*, char const*) [/usr/bin/node]
 3: 0x55a4458c9002 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
 4: 0x55a4458c925b v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
 5: 0x55a445c60573  [/usr/bin/node]
 6: 0x55a445c606b4  [/usr/bin/node]
 7: 0x55a445c70656 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/bin/node]
 8: 0x55a445c70ffe v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node]
 9: 0x55a445c73a1d v8::internal::Heap::AllocateRawWithLightRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/bin/node]
10: 0x55a445c73a72 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/bin/node]
11: 0x55a445c41418 v8::internal::Factory::AllocateRawArray(int, v8::internal::PretenureFlag) [/usr/bin/node]
12: 0x55a445c41934 v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::Heap::RootListIndex, int, v8::internal::Object*, v8::internal::PretenureFlag) [/usr/bin/node]
13: 0x55a445c41a00 v8::internal::Handle<v8::internal::FixedArray> v8::internal::Factory::NewFixedArrayWithMap<v8::internal::FixedArray>(v8::internal::Heap::RootListIndex, int, v8::internal::PretenureFlag) [/usr/bin/node]
14: 0x55a445d7344c v8::internal::HashTable<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::New(v8::internal::Isolate*, int, v8::internal::PretenureFlag, v8::internal::MinimumCapacity) [/usr/bin/node]
15: 0x55a445d9539f v8::internal::BaseNameDictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::EnsureCapacity(v8::internal::Isolate*, v8::internal::Handle<v8::internal::NameDictionary>, int) [/usr/bin/node]
16: 0x55a445d95409 v8::internal::Dictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::Add(v8::internal::Isolate*, v8::internal::Handle<v8::internal::NameDictionary>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyDetails, int*) [/usr/bin/node]
17: 0x55a445ed2fc4 v8::internal::Runtime_AddDictionaryProperty(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/bin/node]
18: 0x13e4d8c4fc5d 
⠦  Building for production...^C⏎

Du dépôt de l'auteur, je n'ai pas de réponse ..

Commentaire le plus utile

TERMINÉ

une seule ligne avec la clé

NODE_OPTIONS=--max_old_space_size=4096 npm run build

Tous les 3 commentaires

Le problème vient de ce dépôt et non d'ici, vous ne pouvez pas simplement ouvrir un problème ici parce que vous n'avez pas obtenu de réponse là-bas...
Si vous trouvez d'où vient spécifiquement le problème ou mieux encore trouvez la solution, veuillez ouvrir un nouveau problème avec une reproduction résumée (pas d'opencv)

@posva
Le problème est dû à la taille énorme du package, il vaut donc mieux savoir comment augmenter la limite de mémoire


il existe une limite standard stricte pour l'utilisation de la mémoire dans le V8 d'environ 1,7 Go, si vous ne l'augmentez pas manuellement.

node --max-old-space-size=4096 yourFile.js

comment faire en vue-cli ?

TERMINÉ

une seule ligne avec la clé

NODE_OPTIONS=--max_old_space_size=4096 npm run build

Cette page vous a été utile?
0 / 5 - 0 notes