minimize java memory usage by nodejs proxies

ccovney
Participant V

I am running Apigee Edge On Prem (private cloud) version 4.15.04.03

Hi everyone,

I am seeing Trireme throwing an error saying that the java heap memory has been depleted:

/apigee4/var/log/apigee/message-processor/logs/system-2016-05-16.2.log.gz:java.lang.OutOfMemoryError: Java heap space
/apigee4/var/log/apigee/message-processor/logs/system-2016-05-16.2.log.gz:2016-05-16 19:11:09,676 org:Foo env:prod api:bar_rev15_2016_04_09 rev:1  Trireme: Foo__prod__bar_rev15_2016_04_09__app.js ERROR NODE_SCRIPT_OUTPUT - LogOutputStream.output() : *** Script app.js exited with status code -1: java.lang.OutOfMemoryError: Java heap space

We have dozens of node.js API proxies, each of them running many of the same node.js modules (express.js, request.js, etc). Is there any way to have these proxies "share" common node modules? I am worried that we have 20+ instances of express.js running when we could in theory let all the proxies share the same set of common node modules. Any thoughts? Any insight would be very much appreciated. Thank you!

Best, Chris

1 2 584
2 REPLIES 2

Hi @Chris Covney

Edge should include a number of commonly used libraries out of the box. Express is certainly supported, and doesn't need to be uploaded each time. You cannot control the version though, so these may not be as up to date as you would like.

Check out here: http://docs.apigee.com/api-services/content/understanding-edge-support-nodejs-modules#supportforcomm...

Sweet, I will look into this. Note our version, though (pretty out of date). I have a feeling express support wasn't added until a later version. Maybe after we update to 16.05 we can leverage the out of the box express support.