Javascript 此错误将终止运行nodejs应用程序的进程
我同时得到以下错误 此错误发生在终端:Javascript 此错误将终止运行nodejs应用程序的进程,javascript,node.js,reactjs,Javascript,Node.js,Reactjs,我同时得到以下错误 此错误发生在终端: <--- Last few GCs ---> ca[6517:0x491af90] 389479 ms: Mark-sweep 2047.1 (2055.3) -> 2046.4 (2056.3) MB, 1381.3 / 0.1 ms (+ 270.2 ms in 38 steps since start of marking, biggest step 19.1 ms, walltime since start of marki
<--- Last few GCs --->
ca[6517:0x491af90] 389479 ms: Mark-sweep 2047.1 (2055.3) -> 2046.4 (2056.3) MB, 1381.3 / 0.1 ms (+ 270.2 ms in 38 steps since start of marking, biggest step 19.1 ms, walltime since start of marking 1686 ms) (average mu = 0.099, current mu = 0.021) alloca[6517:0x491af90] 391293 ms: Mark-sweep 2048.5 (2056.3) -> 2047.9 (2057.3) MB, 1098.9 / 0.1 ms (+ 685.1 ms in 36 steps since start of marking, biggest step 499.1 ms, walltime since start of marking 1814 ms) (average mu = 0.055, current mu = 0.017) alloc
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0x13555cd]
Security context: 0x0b156f1008d1 <JSObject>
1: slice [0x2a241b8bfa91] [buffer.js:~606] [pc=0x2fa7af85cfa6](this=0x2a241b8bfd79 <Object map = 0x9514c326099>,0x3b30a44ce789 <Uint8Array map = 0x9514c3255a9>,52288,52523)
2: parseLengthCodedString [0x3f349708d1f1] [/home/abc/Block-Exporter/node_modules/mysql/lib/protocol/Parser.js:~148] [pc=0x2fa7af5e63e3](this=0x157d3bf8b519 <Parser map = 0x3427fbc0985...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xa093f0 node::Abort() [node]
2: 0xa097fc node::OnFatalError(char const*, char const*) [node]
3: 0xb842ae v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xb84629 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xd30fe5 [node]
6: 0xd31676 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
7: 0xd3def5 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
8: 0xd3eda5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xd4185c v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0xd0f74c v8::internal::Factory::NewRawOneByteString(int, v8::internal::AllocationType) [node]
11: 0xd0ff0d v8::internal::Factory::NewStringFromUtf8(v8::internal::Vector<char const> const&, v8::internal::AllocationType) [node]
12: 0xb9c60f v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int) [node]
13: 0xae34b0 node::StringBytes::Encode(v8::Isolate*, char const*, unsigned long, node::encoding, v8::Local<v8::Value>*) [node]
14: 0x9e35a6 [node]
15: 0x13555cd [node]
我这样做了导出节点\u OPTIONS=“--max old space size=8192”
。但这对我不起作用
我到处都找不到正确的答案
我在下面为特定的js文件添加代码快照。请看里面
这是AccountAllDetail.js中的内容:
componentDidMount() {
this._isMounted = true;
this.findData();
this.findTransactions();
this.findWitnesses();
this.findCommittee();
this.findOperations();
if(!!this.account[1] && this.account[1].includes('1.2'))
this.setState({activeTab: '1'});
else if(!!this.account[1] && this.account[1].includes('1.6'))
this.setState({activeTab: '3'});
else if(!!this.account[1] && this.account[1].includes('1.5'))
this.setState({activeTab: '4'});
}
componentDidUpdate(prevProps) {
if(this.props !== prevProps) {
this.findData();
this.findTransactions();
this.findWitnesses();
this.findCommittee();
this.findOperations();
if(!!this.account[1] && this.account[1].includes('1.2'))
this.setState({activeTab: '1'});
else if(!!this.account[1] && this.account[1].includes('1.6'))
this.setState({activeTab: '3'});
else if(!!this.account[1] && this.account[1].includes('1.5'))
this.setState({activeTab: '4'});
}
}
您正在进行服务器端渲染吗?是的。我需要呈现大量数据。在服务器端呈现组件时,永远不会调用componentdidmount
componentDidMount() {
this._isMounted = true;
this.findData();
this.findTransactions();
this.findWitnesses();
this.findCommittee();
this.findOperations();
if(!!this.account[1] && this.account[1].includes('1.2'))
this.setState({activeTab: '1'});
else if(!!this.account[1] && this.account[1].includes('1.6'))
this.setState({activeTab: '3'});
else if(!!this.account[1] && this.account[1].includes('1.5'))
this.setState({activeTab: '4'});
}
componentDidUpdate(prevProps) {
if(this.props !== prevProps) {
this.findData();
this.findTransactions();
this.findWitnesses();
this.findCommittee();
this.findOperations();
if(!!this.account[1] && this.account[1].includes('1.2'))
this.setState({activeTab: '1'});
else if(!!this.account[1] && this.account[1].includes('1.6'))
this.setState({activeTab: '3'});
else if(!!this.account[1] && this.account[1].includes('1.5'))
this.setState({activeTab: '4'});
}
}