Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hexo g的时候内存溢出.我应该如何监控跟定位这个问题? #3350

Closed
Num142857 opened this issue Nov 13, 2018 · 3 comments
Closed

Comments

@Num142857
Copy link

hexo g的时候内存溢出.我应该如何监控跟定位这个问题?
或者临时解决这个问题.

<--- Last few GCs --->
[4046:0x34aa340]   117342 ms: Mark-sweep 931.9 (1118.0) -> 931.6 (1065.0) MB, 443.9 / 0.0 ms  (average mu = 0.633, current mu = 0.000) last resort GC in old space requested
[4046:0x34aa340]   117727 ms: Mark-sweep 931.6 (1065.0) -> 931.6 (1051.5) MB, 385.2 / 0.0 ms  (average mu = 0.468, current mu = 0.000) last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
    0: ExitFrame [pc: 0xe0ca3c5be1d]
Security context: 0x3bcd26b9e6e1 <JSObject>
    1: byteLength(aka byteLength) [0x2a55f7b05ef1] [buffer.js:532] [bytecode=0x1776c81d96b9 offset=204](this=0x2065f6a026f1 <undefined>,string=0x06b0863ea4d9 <Very long string[215870449]>,encoding=0x3bcd26bbc8d1 <String[4]: utf8>)
    2: arguments adaptor frame: 3->2
    3: fromString(aka fromString) [0x2a55f7b1c2c1] [buffer.js:343] [bytecode=0x1776c81d3911 o...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 0x8daaa0 node::Abort() [hexo]
 2: 0x8daaec  [hexo]
 3: 0xad73ce v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [hexo]
 4: 0xad7604 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [hexo]
 5: 0xec4c32  [hexo]
 6: 0xed444f v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [hexo]
 7: 0xea3ffb v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [hexo]
 8: 0xfed8b3 v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [hexo]
 9: 0xad49f4 v8::internal::String::Flatten(v8::internal::Handle<v8::internal::String>, v8::internal::PretenureFlag) [hexo]
10: 0xae27a0 v8::String::Utf8Length() const [hexo]
11: 0x8f3776  [hexo]
12: 0xb5faef  [hexo]
13: 0xb60659 v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [hexo]
14: 0xe0ca3c5be1d 
/home/travis/.travis/job_stages: line 104:  4046 Aborted                 (core dumped) hexo g
@wpstan
Copy link

wpstan commented Nov 14, 2018

speak english....

@Num142857
Copy link
Author

问题已解决
https://alili.tech/archive/c38d0045/

@lxqxsyu
Copy link

lxqxsyu commented Aug 6, 2019

打开目录 C:\Users\Administrator\AppData\Roaming\npm 找到 hexo文件,然后打开文件修改如下:

#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac

if [ -x "$basedir/node" ]; then
  "$basedir/node"  "$basedir/node_modules/hexo-cli/bin/hexo" "$@"
  ret=$?
else 
-  node  "$basedir/node_modules/hexo-cli/bin/hexo" "$@"
+ node --max_old_space_size=4096 "$basedir/node_modules/hexo-cli/bin/hexo" "$@"
  ret=$?
fi
exit $ret

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants