vekonyz / fast-protocol

FAST streaming protocol for Node.js
MIT License
5 stars 2 forks source link

Allocation failed #2

Open ddkclaudio opened 5 years ago

ddkclaudio commented 5 years ago

const txt = "c0018d9b32303138303631383139323634313630b00184d982dc525453454c31b20456199e834d424fb1804d42503130b1825354c48a544f423230b1825354c48183c03938303038b6c8c0393830303836b2b88080808080cd828282818380828280804252cc4252cc8f53504fd438b0805345cc544158412053454c49c3802f567dc03d03e98080808081813d03e94d4d585858d842d2094e3cf1094d7585808044b12f567dc001314f2f6a6c67468037b4808052d480e05254534ac3045619a6834d424fb1804d42503130b1825354c48a544f423230b1825354c48183c03938303038b7c8c0393830303837b0b88080808080cd828282f98085828280805553c45553c48f53504fd438b080534ac3534f4a412041205649535441202d20434849434147cf802f567dc03d03e9808080803d03e94d4d585858d855d3094e3cf1094d7585808044b12f567dc001314f2f6a6c67468037b4808052d480"
// load fast stream module
var FastStream = require('fast-protocol')

// create message decoder
// ftp://ftp.bmf.com.br/FIXFAST/templates/Production/templates-PUMA.xml
var decoder = new FastStream.Decoder('templates-PUMA.xml')

// read binary buffer - user specific function
var buffer = Buffer.from(txt, 'hex');

// // decode buffer content
decoder.decode(buffer, function (msg, name) {
    console.log(name, JSON.stringify(msg, null, 2))
})

the following error occurred would you have an idea of why or how to solve? the same message fast using quickfast and decoded correctly.

error result

<--- Last few GCs --->

[10276:000001DD7F8FDF80]    25161 ms: Mark-sweep 1365.5 (1390.8) -> 1365.5 (1390.8) MB, 754.7 / 0.0 ms  (average mu = 0.607, current mu = 0.000) last resort GC in old space requested
[10276:000001DD7F8FDF80]    25929 ms: Mark-sweep 1365.5 (1390.8) -> 1365.5 (1390.8) MB, 767.2 / 0.0 ms  (average mu = 0.423, current mu = 0.000) last resort GC in old space requested

<--- JS stacktrace --->

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

    0: ExitFrame [pc: 000000558E55C5C1]
Security context: 0x0343d651e6e1 <JSObject>
    1: /* anonymous */ [00000026F93610A9] [C:\Users\ddkcl\Desktop\test\node_modules\fast-protocol\index.js:~846] [pc=000000558E80E4D6](this=0x02c82cceb101 <Decoder map = 000000F899D59861>,ctx=0x020a62a186c1
<Context map = 000000F899D5BF39>,sequence=0x020a62a18669 <Element map = 000000F899D5BDD9>)
    2: /* anonymous */ [00000026F9361069] [C:\Users\ddkcl\De...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 00007FF72A08121A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4810
 2: 00007FF72A05A5B6 node::MakeCallback+4518
 3: 00007FF72A05AFA0 node_module_register+2160
 4: 00007FF72A2EB3EE v8::internal::FatalProcessOutOfMemory+846
 5: 00007FF72A2EB31F v8::internal::FatalProcessOutOfMemory+639
 6: 00007FF72A829304 v8::internal::Heap::MaxHeapGrowingFactor+11476
 7: 00007FF72A827098 v8::internal::Heap::MaxHeapGrowingFactor+2664
 8: 00007FF72A3C9C08 v8::internal::Factory::AllocateRawArray+56
 9: 00007FF72A3CA582 v8::internal::Factory::NewFixedArrayWithFiller+66
10: 00007FF72A432E5B v8::internal::HashTable<v8::internal::NumberDictionary,v8::internal::NumberDictionaryShape>::EntryToIndex+70043
11: 00007FF72A84F540 v8::internal::Bitmap::IsClean+30464
12: 000000558E55C5C1`
vekonyz commented 5 years ago

Hi Claudio,

you use decimal fields with individual operators for mantissa/exponent; this feature is still not supported. See Readme.MD for more details / limitation.

<decimal name="EndTickPriceRange" id="1207" presence="optional">
<exponent>
<copy value="-2"/>
</exponent>
<mantissa>
<delta/>
</mantissa>
</decimal>
vekonyz commented 5 years ago

@ddkclaudio shall I spend some time and add support for this?

ddkclaudio commented 5 years ago

Thanks!! I am anxiously waiting!!