senecajs / seneca

A microservices toolkit for Node.js.
http://senecajs.org
MIT License
3.96k stars 314 forks source link

Seneca Metadata log holding in memory #738

Open MathavanN opened 5 years ago

MathavanN commented 5 years ago

I am currently using Seneca as NodeJs microservices tool kit. We are experiencing memory leak. below is my Heap snapshot details. Capture1 Snapshot 3, considered after we processed a large payload. below is the comparison of Snapshot 1 and Snapshot 3 Capture Trying to analyze the snapshots. Found that, Array size increasing. I guess, it keep storing Seneca metadata log info. Please correct me, If my assumption is wrong. Can anybody guide me to fix this problem

alloyit commented 5 years ago

We also use Seneca (v2) in huge projects and experienced same problem. We found that there is a cache enabled by default in seneca/seneca.js (row 118 for our installation). Once set actcache.active to false the memory leak do not occur anymore.

MathavanN commented 5 years ago

@alloyit I am using Seneca v3.8.4, below is the Seneca configuration, already disabled history. let seneca = require('seneca')({ log: 'silent', timeout: mqConfig.timeout || 14400000, history: { active: false } });