Closed JLKM closed 8 years ago
i also gotheap out of memory
error when i generate more than 1000 docs.
i solve it by fatal-error-call-and-retry-last-allocation-failed-process-out-of-memory
i think this issue related to both node and hexo.
if you've dump the struct of post object, you'll see a huge object, i guess if you disable some plugin and features, you can solve it.
Thank you for your advice.
"hexo-generator-search": "^1.0.2"
and "hexo-generator-json-content": "^2.2.0"
from hexo package.json, but it only speeded generation up with a few seconds. It didn't make generation of more documents possible fr me.I soon realised that it's much easier to put the parameters directly into the command-prompt, and the result didn't differ from putting the parameters into:
C:\Users\Username\AppData\Roaming\npm\node_modules\hexo-cli\bin\hexo
.
Did make it possible for me to generate about 1200 posts - opposed to a few hundreds with hexo g and no parameters. At this time I need to generate 3000 posts, but attempts to generate more than approx. 1200 posts resulted in various error (see below). 12288 seemed to be best fit on my 16 GB RAM laptop. Values below tend to pull down the limit, but higher values didn't push the limit up.
Did increase the number of generations with a couple of hundreds when running hexo g together with f.ex. --max_old_space_size=8192. But the parameter was not able to move the maximum number of successfully generated posts.
Also tested with 8192, 4096 and 2048. None of the different values made any observable difference.
No help according to your source. So I didn't test that one.
The most common error in my test.
Usually turned up when fairly close to the upper limit (but on the wrong side).
Only encountered once, when the upper limit was really close.
Showed up on one occation, when upper limit was even closer (<10 docs). This one is somewhat weird, since the referred file has not 14 lines but only 5 (see below).
1. #!/usr/bin/env node
2.
3. 'use strict';
4.
5. require('../lib/hexo')();
According to my tests, the themes are not to blame for the upper limit as such. Swithing themes apparently moves the upper limit of posts about 100 or 200 up or down. This is likely caused by the various amount of html needed for the different designs. In my case Icarus had the highest upper limit. Hueman ended in the middle, and the lowest amount of possible generated posts was experienced with bootstrap-blog.
After this (several days of nightmare) I went all in and downgraded to Hexo 3.1.1 - as suggested in #1831.
Hexo package.json was changed to:
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"hexo": {
"version": "3.1.1"
},
"dependencies": {
"hexo": "3.1.1",
... etc. ...
}
}
The following npm install resulted in a lot of warnings:
npm WARN deprecated nunjucks@1.3.4: potential XSS vulnerability in autoescape mode, and with escape filter was fixed in v2.4.3
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated swig@1.4.2: This package is no longer maintained
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@2.0.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm WARN optional Skipping failed optional dependency /nunjucks/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@0.3.8
And the following hexo g with parameters not only ended in an error message. It went totally bananas returning some of the following error-lines for each entry:
ERROR Process failed: _posts/209B3447F4562503C1257DE10041CC6A.md
Error: Category `2013` has already existed!
at D:\vscode\hexo\Odense\tredjesite\node_modules\hexo\lib\models\category.js:71:13
at tryCatcher (D:\vscode\hexo\Odense\tredjesite\node_modules\warehouse\node_modules\bluebird\js\main\util.js:26:23)
at D:\vscode\hexo\Odense\tredjesite\node_modules\warehouse\node_modules\bluebird\js\main\method.js:15:34
at D:\vscode\hexo\Odense\tredjesite\node_modules\warehouse\lib\model.js:193:12
Finally I took the opposite approach and upgraded my Hexo ^3.2.0
to 3.2.2
- in order to test the absolute latest version.
Unfortunately this wasn't enough to move the upper limit, either.
Please, anyone, make clear once and for all, that Hexo doesn't have an unbreakable upper limit of approx. 1000-1200 posts. And please also show exactly how to get around this limit.
hold on, i'll check my config, it may helpful to you. i've generated approx. 1000+ post last month.
I've tested all suggestions in Hexo-blog #1. But I have not yet been able to run a successful Hexo generate with more than 1200 docs. Not on:
Just can't be right, that 1200 docs eat up 12 GB of RAM...
Please step forward, anyone, who has been able to generate bigger sites with Hexo.
Or do we all really have to wait for the advertised upgrade of memory handling in Node.js 7.X.?
You can read more about Su Yang's and my resultless efforts to solve this.
Options left in my view at this time:
A real showstopper for some. And a real pity. Hexo has the lead in almost every other field - in my view.
After lots of failed tests with generation of thousands of docs in Windows with 16 GB RAM, I made the same tests on a Linux setup - also with 16 GB RAM. With high hopes. But they were not fulfilled.
Created a user on Digitalocean and made an installation with Ubuntu 16.04, Node.js 6.6 and Hexo.
Then I ran a handful of tests with 2995 docs and then with 2007 docs. hexo g No luck. _hexo generate "node --max_old_space_size=12288 --optimize_for_size --max_executable_size=12288 --stacksize=12288" No luck _hexo generate "node --max_old_space_size=8196 --optimize_for_size --max_executable_size=8196 --stacksize=8196" No luck
Exactly the same error each and every time (written by hand):
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [hexo]
2: 0x10dc06c [hexo]
3: v8::Utils::ReportApiFailure(char const*, char const*) [hexo]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [hexo]
5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [hexo]
6: v8::internal::Runtime_StringBuilderConcat(int, v8::internal::Object**, v8::internal::Isolate*) [hexo]
7: 0x1a78d1c092a7
Aborted (core dumped)
This is really frustrating. Does anyone have a clue?
Noone deserves to waste as many days, as I did, trying to tweak Hexo into generating more than 1200 docs. Nothing indicates, that it's possible at this time. Really look forward to a solution for this issue on this otherwise great SSG. A piece of advice, if you need this feature now: Hugo: 11.980 docs in 4 minutes and 40 seconds.
hi,boys,my error: FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory i need help.
@hank583746309 目前我也碰到了同样的问题,文章数量在1040左右,已经开始出现同样的问题了 不知道大家是怎么解决这个问题的?
Hexo generate debug outputs fine, final output 'Killed' & nothing output to public folder. 1 core, 1GB RAM VPS. hexo-server over generate? 730 posts.
I was able to generate over 3,000 files with 8gb of ram
I used the following:
node --max-old-space-size=8192 node_modules/hexo-cli/bin/hexo gen -c 1 -dw
Ok, trying on 33103 files and getting fail at 16 gb
#!/usr/bin/env node --max_old_space_size=16384
in node_modules/hexo-cli/bin/hexo
Error:
<--- Last few GCs --->
[137:0x7964cb02b000] 33039 ms: Scavenge (reduce) (interleaved) 3446.1 (3671.1) -> 3446.1 (3668.1) MB, pooled: 0 MB, 8.24 / 0.00 ms (average mu = 0.274, current mu = 0.252) external memory pressure;
[137:0x7964cb02b000] 33791 ms: Mark-Compact (reduce) 3446.3 (3668.1) -> 3444.6 (3648.6) MB, pooled: 0 MB, 96.37 / 0.00 ms (+ 649.8 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 789 ms) (average mu = 0.262,
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
Aborted (core dumped)
AND, here is the error at 32gb
<--- Last few GCs --->
[148:0x7aed4cf6f000] 34166 ms: Scavenge (reduce) (interleaved) 3444.6 (3660.1) -> 3444.6 (3657.1) MB, pooled: 0 MB, 8.24 / 0.00 ms (average mu = 0.262, current mu = 0.248) external memory pressure;
[148:0x7aed4cf6f000] 34920 ms: Mark-Compact (reduce) 3444.7 (3657.1) -> 3443.1 (3638.9) MB, pooled: 0 MB, 99.86 / 0.00 ms (+ 648.2 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 791 ms) (average mu = 0.256,
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
Aborted (core dumped)
here is the current workflow step I'm using in my github actions:
- name: Build site
env:
NODE_OPTIONS: --max-old-space-size=5168
run: |
npm install
node_modules/hexo/bin/hexo gen -c 1
hexo g
's with 100-200 docs without problems at all, I ran into a wall yesterday when trying to run a full scale hexo generation with 3000 docs.Worth noting:
Possible culprits:
–max-new-space-size=XXXX
Any advice would be most appreciated
My setup:
My full hexo-cli package.json for scrutenizing: