I'm using Node-Addon-Api to create addons in NodeJS. every 30 second there is a call to a addon's function, every time the function is called 4 double arrays, with highest array size of 2400 values, are been created. I'm experiencing memory overload, so i was wondering it could be because on these 4 arrays. do I need to handle every object that been created with the function New()? like Napi::Array::New or Napi::Number::New ?
for example:
Napi::Array plotHistory_Napi_out = Napi::Array::New(env, 2400);
do i need to release this memory? if so how?
or it happens automatically when the scope is function ends? and nodeJS GC sees it and collects it?
i will appreciate if anyone can assist me, please?