jnordberg / wintersmith

A flexible static site generator
http://wintersmith.io/
MIT License
3.5k stars 332 forks source link

Memory allocation error when trying to see plugins list #314

Closed oleggromov closed 7 years ago

oleggromov commented 8 years ago

Hi!

I have an issue while trying to run

$ wintersmith plugin list
  fetching listing for the first time... hang on
  warn npm: Building the local index for the first time, please be patient

<--- Last few GCs --->

   30268 ms: Mark-sweep 882.2 (1149.5) -> 881.5 (1158.5) MB, 666.9 / 0 ms (+ 22.5 ms in 176 steps since start of marking, biggest step 10.1 ms) [allocation failure] [GC in old space requested].
   31180 ms: Mark-sweep 881.5 (1158.5) -> 856.5 (1136.1) MB, 911.8 / 0 ms [allocation failure] [GC in old space requested].
   32166 ms: Mark-sweep 856.5 (1136.1) -> 856.4 (1127.1) MB, 986.1 / 0 ms [last resort gc].
   33047 ms: Mark-sweep 856.4 (1127.1) -> 856.4 (1120.1) MB, 880.7 / 0 ms [last resort gc].

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x1d8caadc9e59 <JS Object>
    1: fromString(aka fromString) [buffer.js:194] [pc=0x379971cc8dd0] (this=0x1d8caad04189 <undefined>,string=0x23a56b3550a1 <Very long string[183701701]>,encoding=0x1d8caadd7a49 <String[4]: utf8>)
    2: from [buffer.js:94] [pc=0x379971ca6eb6] (this=0x26667d8f0dd1 <JS Function Buffer (SharedFunctionInfo 0x1d8caade3541)>,value=0x23a56b3550a1 <Very long string[183701701]>,encodingOrOffset=0x1d8c...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/local/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
 3: v8::Utils::ReportApiFailure(char const*, char const*) [/usr/local/bin/node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
 5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/usr/local/bin/node]
 6: v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [/usr/local/bin/node]
 7: v8::String::WriteUtf8(char*, int, int*, int) const [/usr/local/bin/node]
 8: node::StringBytes::Write(v8::Isolate*, char*, unsigned long, v8::Local<v8::Value>, node::encoding, int*) [/usr/local/bin/node]
 9: node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) [/usr/local/bin/node]
10: node::Buffer::CreateFromString(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/bin/node]
11: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [/usr/local/bin/node]
12: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::(anonymous namespace)::BuiltinArguments<(v8::internal::BuiltinExtraArguments)1>) [/usr/local/bin/node]
13: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
14: 0x37997180961b
Abort trap: 6

All this was run on MacOS with those versions of node and npm:

$ node -v
v6.3.0

$ npm -v
3.10.5

If you need any additional information to debug this issue, please write.

denizdogan commented 8 years ago

FWIW, happens to me too with:

c:\Users\E>node -v && npm -v
v6.4.0
3.10.3

c:\Users\E>wintersmith --version
2.3.2
jnordberg commented 7 years ago

Yeah I'm aware of this, noting much to do at the moment short of rolling our own npm registry search function. https://github.com/npm/npm/issues/11010