Giter VIP home page Giter VIP logo

l10ns's People

Contributors

bitdeli-chef avatar cadesalaberry avatar elevenbeans avatar focusaurus avatar froskie avatar gitter-badger avatar h-wijaya avatar igoromelyaniuk avatar jennypypy avatar maininfection avatar maryam-saeidi avatar nmn avatar ssahinoglu avatar taktakpeops avatar tinganho avatar vitorarins avatar waffle-iron avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

elevenbeans

l10ns's Issues

ERROR: JavaScript heap out of memory; When value of label is invalid

Labels cannot compile when the value with template is invalid and is processed by handlebars.

When some of the value is invalid the node process cannot compile that label and exit with log:

<--- Last few GCs --->

[22286:0x223aeb0]    25933 ms: Mark-sweep 1290.6 (1367.9) -> 1290.5 (1349.9) MB, 992.4 / 0.0 ms  allocation failure GC in old space requested
[22286:0x223aeb0]    26930 ms: Mark-sweep 1290.5 (1349.9) -> 1290.5 (1312.9) MB, 996.9 / 0.0 ms  last resort GC in old space requested
[22286:0x223aeb0]    27856 ms: Mark-sweep 1290.5 (1312.9) -> 1290.5 (1312.9) MB, 925.5 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

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

Security context: 0x1c951ea5749 <JSObject>
    1: push(this=0x11296b1b5669 <JSArray[33426304]>)
    2: parse [/home/umiranchuk/Projects/project/node_modules/l10ns/libraries/MessageFormat/index.js:~194] [pc=0x2068abd1edfd](this=0xa8ec8e84281 <MessageFormat map = 0x11ef615694b1>,message=0x1e7f57242a1 <String[18]: date} at {time}hrs>)
    3: /* anonymous */ [/home/umiranchuk/Projects/projct/node_modules/l10ns/plugins/han...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [node]
 2: 0x11df13c [node]
 3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
 5: v8::internal::factory::NewUninitializedFixedArray(int) [node]
 6: 0xde93bf [node]
 7: 0xdfd2e5 [node]
 8: v8::internal::JSObject::AddDataElement(v8::internal::Handle<v8::internal::JSObject>, unsigned int, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow) [node]
 9: v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow, v8::internal::Object::StoreFromKeyed) [node]
10: v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::LanguageMode, v8::internal::Object::StoreFromKeyed) [node]
11: v8::internal::Runtime_SetProperty(int, v8::internal::Object**, v8::internal::Isolate*) [node]
12: 0x2068abb842fd
Aborted (core dumped)

The issue is in json file with label that has the key 'value'. In that key is stored something wrong like:
date} at {time}hrs but should be {date} at {time}hrs

Might be it is a good idea to validate json file before parsing it and processing

Example of wrong json:

{   
     "id": "hotel.checkOutDate",
     "key": "hotel.checkOutDate",
    "value": "date} at {time}hrs"
}

Repo to reproduce the hanging of 10ns. It does not provide the same error, but demonstrates the problem:

https://github.com/ilabacheuski/l10ns-memory-leak

git clone https://github.com/ilabacheuski/l10ns-memory-leak.git
cd l10ns-memory-leak
npm i -g l10ns
echo ">>> After this step the process will hang on"
l10ns compile

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.