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

Memory usage when generating large site #1763

Closed
leesei opened this issue Feb 20, 2016 · 5 comments
Closed

Memory usage when generating large site #1763

leesei opened this issue Feb 20, 2016 · 5 comments
Labels
enhancement New feature or request #perfmatters

Comments

@leesei
Copy link
Member

leesei commented Feb 20, 2016

#1735
#1529

I'll try to recreate the environment first.

@leesei leesei added the enhancement New feature or request label Feb 20, 2016
@leesei
Copy link
Member Author

leesei commented Feb 20, 2016

Generate stub files with leesei/hexo-genstubs.

With genstubs.js -N 5000 -P 100:

229M    source/_posts
128M    stub-posts.zip

UPDATE: genstubs.js -N 500 -P 100 is enough to trigger OOM.

This is enough to generate OOM on my Arch Linux with 8G RAM.
The Hexo site is generated by hexo init.

hexo-cli@0.1.9
hexo@3.1.1
hexo-generator-archive@0.1.4
hexo-generator-category@0.1.3
hexo-generator-index@0.2.0
hexo-generator-tag@0.2.0
hexo-renderer-ejs@0.1.1
hexo-renderer-marked@0.2.10
hexo-renderer-stylus@0.3.1
hexo-server@0.1.3
$ hexo generate

<--- Last few GCs --->

    7958 ms: Scavenge 1408.7 (1457.0) -> 1408.7 (1457.0) MB, 17.1 / 0 ms (+ 33.0 ms in 1 steps since last GC) [allocation failure] [incremental marking delaying mark-sweep].
    8984 ms: Mark-sweep 1408.7 (1457.0) -> 1405.9 (1454.0) MB, 1026.3 / 0 ms (+ 967.1 ms in 2405 steps since start of marking, biggest step 33.0 ms) [last resort gc].
   10009 ms: Mark-sweep 1405.9 (1454.0) -> 1405.8 (1457.0) MB, 1024.3 / 0 ms [last resort gc].

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

@tommy351
Copy link
Member

Thanks for the test. 💯 👍

@xieguigang
Copy link

xieguigang commented Jun 13, 2016

My site have over 8000 pages, and encounter this problem too, where launch hexo with server command, then hexo out of memory, but if launched with generate command, it give me this problem:

$ hexo generate
INFO  Start processing
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Template render error: (unknown path) [Line 4, Column 929]
  expected variable end
    at Object.exports.prettifyError (D:\gcmodeller-hexo\docs\node_modules\nunjucks\src\lib.js:34:15)
    at Obj.extend.render (D:\gcmodeller-hexo\docs\node_modules\nunjucks\src\environment.js:468:27)
    at Obj.extend.renderString (D:\gcmodeller-hexo\docs\node_modules\nunjucks\src\environment.js:326:21)
    at D:\gcmodeller-hexo\docs\node_modules\hexo\lib\extend\tag.js:66:9
    at Promise._execute (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\debuggability.js:272:9)
    at Promise._resolveFromExecutor (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\promise.js:473:18)
    at new Promise (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\promise.js:77:14)
    at Tag.render (D:\gcmodeller-hexo\docs\node_modules\hexo\lib\extend\tag.js:64:10)
    at Object.tagFilter [as onRenderEnd] (D:\gcmodeller-hexo\docs\node_modules\hexo\lib\hexo\post.js:253:16)
    at D:\gcmodeller-hexo\docs\node_modules\hexo\lib\hexo\render.js:63:19
    at tryCatcher (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\promise.js:502:31)
    at Promise._settlePromise (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\promise.js:559:18)
    at Promise._settlePromise0 (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\promise.js:604:10)
    at Promise._settlePromises (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\promise.js:683:18)
    at Async._drainQueue (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\async.js:138:16)
    at Async._drainQueues (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\async.js:148:10)
    at Immediate.Async.drainQueues [as _onImmediate] (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\async.js:17:14)
    at tryOnImmediate (timers.js:543:15)
    at processImmediate [as _immediateCallback] (timers.js:523:5)
FATAL (unknown path) [Line 4, Column 929]
  expected variable end
Template render error: (unknown path) [Line 4, Column 929]
  expected variable end
    at Object.exports.prettifyError (D:\gcmodeller-hexo\docs\node_modules\nunjucks\src\lib.js:34:15)
    at Obj.extend.render (D:\gcmodeller-hexo\docs\node_modules\nunjucks\src\environment.js:468:27)
    at Obj.extend.renderString (D:\gcmodeller-hexo\docs\node_modules\nunjucks\src\environment.js:326:21)
    at D:\gcmodeller-hexo\docs\node_modules\hexo\lib\extend\tag.js:66:9
    at Promise._execute (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\debuggability.js:272:9)
    at Promise._resolveFromExecutor (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\promise.js:473:18)
    at new Promise (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\promise.js:77:14)
    at Tag.render (D:\gcmodeller-hexo\docs\node_modules\hexo\lib\extend\tag.js:64:10)
    at Object.tagFilter [as onRenderEnd] (D:\gcmodeller-hexo\docs\node_modules\hexo\lib\hexo\post.js:253:16)
    at D:\gcmodeller-hexo\docs\node_modules\hexo\lib\hexo\render.js:63:19
    at tryCatcher (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\promise.js:502:31)
    at Promise._settlePromise (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\promise.js:559:18)
    at Promise._settlePromise0 (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\promise.js:604:10)
    at Promise._settlePromises (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\promise.js:683:18)
    at Async._drainQueue (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\async.js:138:16)
    at Async._drainQueues (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\async.js:148:10)
    at Immediate.Async.drainQueues [as _onImmediate] (D:\gcmodeller-hexo\docs\node_modules\bluebird\js\release\async.js:17:14)
    at tryOnImmediate (timers.js:543:15)
    at processImmediate [as _immediateCallback] (timers.js:523:5)

@leesei
Copy link
Member Author

leesei commented Jun 13, 2016

@xieguigang Refer to #1771 (comment) to help you debug "Template render error".
You probably have an invalid tag. You are welcome to post your test case there.

@stevenjoezhang
Copy link
Member

Closing due to #3756

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request #perfmatters
Projects
None yet
Development

No branches or pull requests

4 participants