Closed soulteary closed 8 years ago
Awesome idea to extend Hexo with a plugin for 1000+ docs websites. Really appreciate your commitment in this area.
Made a clone of your repo this morning - but still no luck.
Here is, how I followed your instructions:
1) $ git clone --branch master --depth 1 --single-branch https://github.com/soulteary/hexo-blog.git hexo-blog
2) $ cd hexo-blog
3) $ ./bin/install.sh
Dropped --use-cnpm
as I live in Denmark. Returned the following warnings, which I just accepted:
npm WARN deprecated swig@1.4.2: This package is no longer maintained
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN prefer global marked@0.3.6 should be installed with -g
> dtrace-provider@0.6.0 install D:\vscode\hexo\hexo-blog\node_modules\dtrace-provider
> node scripts/install.js
> hexo-util@0.6.0 postinstall D:\vscode\hexo\hexo-blog\node_modules\hexo-util
> npm run build:highlight
> hexo-util@0.6.0 build:highlight D:\vscode\hexo\hexo-blog\node_modules\hexo-util
> node scripts/build_highlight_alias.js > highlight_alias.json
> hexo-extend-plugin@0.1.8 postinstall D:\vscode\hexo\hexo-blog\node_modules\hexo-extend-plugin
> patch/index.js --backup
4) Changed C:\Users\Name\AppData\Roaming\npm\node_modules\hexo-cli\bin\hexo to:
#!/usr/bin/env node --max_old_space_size=4096 --optimize_for_size --max_executable_size=4096 --stack_size=4096`
'use strict';
require('../lib/hexo')();
5) $ ./node_modules/.bin/hexo g
with the aprox. 23 docs included in your sample. No errors during generation. No errors at localhost:4000
6) Replaced your posts with 1786 of my own in main _source-folder.
7) $ ./node_modules/.bin/hexo g
with this error:
Nyt forsøg med 1786 poster:
Jan@JLKM1 MINGW64 /d/vscode/hexo/hexo-blog (master)
$ ./node_modules/.bin/hexo g
INFO Start processing
INFO Files loaded in 1.93 min
[hexo-extend-plugin@generate] convert dir list done: _posts
FATAL ERROR: Scavenger: semi-space copy
Allocation failed - process out of memory
8) Changed C:\Users\Name\AppData\Roaming\npm\node_modules\hexo-cli\bin\hexo to:
#!/usr/bin/env node --max_old_space_size=8192 --optimize_for_size --max_executable_size=8192 --stack_size=8192
'use strict';
require('../lib/hexo')();
Loading-time 1.77 - but same error as in 7 above.
9) Divided the posts into 3 subfolders with approx. 600 docs each. Did this twice - but same story. New error-message in the first run, though. Please look below.
Jan@JLKM1 MINGW64 /d/vscode/hexo/hexo-blog (master)
$ hexo clean
INFO Deleted database.
INFO Deleted public folder.
Jan@JLKM1 MINGW64 /d/vscode/hexo/hexo-blog (master)
$ ./node_modules/.bin/hexo g
INFO Start processing
INFO Files loaded in 2.32 min
[hexo-extend-plugin@generate] convert dir list done: _posts
FATAL ERROR: CALL\_AND\_RETRY\_LAST Allocation failed - JavaScript heap out of memo ry
Public-folder is created - but with no docs in it.
Should I also use command hexo extend-features --on
somehow?
My setup:
Name | Version |
---|---|
Windows | 10 |
RAM | 16 GB |
Node.js | 6.3.1 |
Any suggestions where to go from here?
@JLKM , i've never generate posts/(coding) on windows recently....
Hmmmm...
hexo g
twice without clean and dirs.#!/usr/bin/env node --max_old_space_size=4096 --optimize_for_size --max_executable_size=4096 --stack_size=4096
to improve your runtime and try to upgrade your node version. (i use v6.5+
...)Good Luck.
Thank you for your handful of advice. Unfortunately still no luck - at least with Hexo.
Here my comments one after one:
Hexo/bin-setting:
#!/usr/bin/env node --max_old_space_size=768 --optimize_for_size --max_executable_size=768 --stack_size=768
857 docs
# hexo clean
INFO Deleted database.
# hexo g
INFO Start processing
INFO Files loaded in 15 min
<--- Last few GCs --->
4143980 ms: Scavenge 549.4 (716.6) -> 549.3 (716.6) MB, 1345.7 / 0 ms [allocation failure].
4144034 ms: Scavenge 549.4 (716.6) -> 549.3 (716.6) MB, 50.1 / 0 ms [allocation failure].
4144089 ms: Scavenge 549.3 (716.6) -> 549.3 (716.6) MB, 55.5 / 0 ms [allocation failure].
4144121 ms: Scavenge 549.6 (716.6) -> 549.5 (716.6) MB, 6.2 / 0 ms [allocation failure].
4144129 ms: Scavenge 549.6 (716.6) -> 549.6 (716.6) MB, 6.0 / 0 ms [allocation failure].
<--- JS stacktrace --->
Cannot get stack trace in GC.
FATAL ERROR: Scavenger: semi-space copy
Allocation failed - process out of memory
Back to Windows:
$ hexo g "node --stack_size=12288 --max-old-space-size=12288"
INFO Start processing
INFO Files loaded in 5.73 min
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
$ hexo g "node --stack_size=12288 --max-old-space-size=12288"
INFO Start processing
INFO Files loaded in 5.75 min
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
#!/usr/bin/env node --max_old_space_size=8192 --optimize_for_size --max_executable_size=8192 --stack_size=8192
And these commands:
$ ./node_modules/.bin/hexo g
INFO Start processing
INFO Files loaded in 2.55 min
[hexo-extend-plugin@generate] convert dir list done: _posts
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
The rest:
You mention in Hexo #2165, that you have been able to generate 1000+ docs with Hexo last month. So have I (but not so many more than that)!
The challenge is, that I need to crete Hexo-sites with 3000-10.000 docs. Have you been able to do that?
If yes: How did you succeed, and did you use Hexo or your own plugin?
Made a test on Linux. The Linux setup has only 1 GB of RAM.
Try to set a huge swap, only 1G RAM o is too small to 3000 posts..
I think you should give node.js more RAM resource through it's swap, and use node like this:
#!/usr/bin/env node --max_old_space_size=4096 --optimize_for_size --max_executable_size=4096 --stack_size=4096
maybe you need set RAM more than 8192+ ?
@JLKM maybe there's another way to solve it, use hexo server instead of generate, and use nginx or redis for static resource cache. i've tried this for last month because hexo could not generate more than 1000+ posts as default.
Thank you once again for your suggestions. Have tried them all - and some more. Still no luck.
hexo-cli\bin\hexo
:
#!/usr/bin/env node --max_old_space_size=4096 --optimize_for_size --max_executable_size=4096 --stack_size=4096
Result: A blinking cursor for many minutes. Not even this message:INFO Start processing
INFO Files loaded in 2 min
# hexo g "node --max_old_space_size=12288 --optimize_for_size --max_executable_size=12288 --stack_size=12288"
No better result than this:
INFO Start processing
INFO Files loaded in 13 min
<--- Last few GCs --->
12401112 ms: Mark-sweep 352.4 (716.6) -> 339.5 (716.6) MB, 355340.7 / 0 ms [allocation failure] [GC in old space requested].
12850521 ms: Mark-sweep 339.5 (716.6) -> 339.4 (716.6) MB, 449406.7 / 19 ms [allocation failure] [GC in old space requested].
13282137 ms: Mark-sweep 339.4 (716.6) -> 339.3 (716.6) MB, 431553.4 / 26 ms [last resort gc].
13603690 ms: Mark-sweep 339.3 (716.6) -> 339.3 (716.6) MB, 321553.3 / 19 ms [last resort gc].
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x4eb78695 <JS Object>
1: valueOf [native v8natives.js:~80] [pc=0x492f28a4] (this=0xf2b89565 <JS Function linkToHelper (SharedFunctionInfo 0x432bbb3d)>)
6: createWrap [/share/CACHEDEV1_DATA/odense/node_modules/lodash/lodash.js:~5418] [pc=0xc2165fc4] (this=0x4eb8ba25 <JS Global Object>,func=0xf2b89565 <JS Fun ction linkToHelper (SharedFunctionInfo 0x432bbb3d)>,bitmask=1,thisArg=0x27a1a1d9 <an Object with map 0x2185...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memo ry
Aborted
#!/usr/bin/env node
in hexo-cli\bin\hexo
and less than about 700 docs.$ ./node_modules/.bin/hexo g "node --stack_size=12288 --max-old-space-size=12288"
INFO Start processing
INFO Files loaded in 2 min
[hexo-extend-plugin@generate] convert dir list done: _posts
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
The depressing result can be seen in last line.
Hexo generation in Hexo-folder og node_modules-folder apparently makes no difference for me. And you now admit, that you haven't been able to generate more than about 1000 docs at a time in Hexo. So I guess, we're stuck in this field.
Options left:
No solution for this in sight on Hexo at this time. So please close this issue. But the solution do exist elsewhere: Hugo: 11.980 docs in 4 minutes and 40 seconds.
bad option: --max_executable_size=4096
max_executable_size
has been removed since node 8
I see someone met this problem again, so i write this.
use this instead of
#!/usr/bin/env node