从ag-grid-community迁移到ag-grid-enterprise,并且角度导致堆内存不足

时间:2019-12-12 22:36:18

标签: ag-grid ag-grid-angular

我从ag-grid-community开始检查它的功能并将其应用到我们的应用程序中,并获得了成功。我想过渡到企业来使用这些功能,但是当我切换为使用@ag-grid-enterprise/all-modules并尝试运行我的应用程序时,它开始抛出FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory错误。当我切换回ag-grid-community时,它可以运行了。我尝试了/usr/local/bin/node --max-old-space-size=8092建议(即使数字更高),但仍然得到相同的结果。以下是产生的一些输出。

<--- Last few GCs --->

[54531:0x110000000]    48815 ms: Mark-sweep 1296.0 (1442.8) -> 1279.7 (1440.8) MB, 659.4 / 0.0 ms  (average mu = 0.166, current mu = 0.092) allocation failure scavenge might not succeed
[54531:0x110000000]    49521 ms: Mark-sweep 1293.0 (1440.8) -> 1282.9 (1442.8) MB, 680.0 / 0.0 ms  (average mu = 0.104, current mu = 0.037) allocation failure scavenge might not succeed


<--- JS stacktrace --->

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

    0: ExitFrame [pc: 0x2ba46df5be3d]
    1: StubFrame [pc: 0x2ba46df483f3]
Security context: 0x032486c9e6e9 <JSObject>
    2: match [0x32486c904d1](this=0x032474daf801 <String[70]\:     GridOptionsWrapper.prototype.isEmbedFullWidthRows = function () {\n>,0x03245c5bcee1 <JSRegExp <String[26]: (?!$)[^\n\r;{}]*[\n\r;{}]*>>)
    3: /* anonymous */(aka /* anonymous */) [0x324e9bf4251] [/Users/erflor/Development/Project/site/node_modules/webpa...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x10003cf99 node::Abort() [/usr/local/bin/node]
2: 0x10003d1a3 node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
3: 0x1001b7835 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
4: 0x100585682 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
5: 0x100588155 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/usr/local/bin/node]
6: 0x100583fff v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]

1 个答案:

答案 0 :(得分:1)

我在package.json的脚本部分更新了构建命令,错误消失了。

  "scripts": {
    "ng": "ng",
    "start": "ng s",
    "build": "echo 'build' && npm run version && ng build",
    "build:dev": "echo 'build:dev' && node --max_old_space_size=8192 ./node_modules/@angular/cli/bin/ng build --configuration=dev",