1

I was running my node (express) application on pm2 before and it was working fine. I decided to move it to IIS and setup everything. However it started working for static pages but in where I am connecting database and getting result I am facing memory issue and getthing the following error.

enter image description here

When I checked I found the code snippet which throw this error.

const getDB = () => {
    return new Promise((resolve, reject) => {
        pool.get((err, db) => {
            if (err)
                reject(err)
            resolve(db)
        })
    });
}

I tried to increase the size of heap memory but not getting over come.

'use strict'

const v8 = require('v8')

const totalHeapSize = v8.getHeapStatisctics().total_available_size

let totalHeapSizeInGB = (totalHeapSize /1024 /1024/ 1024).toFixed(2)

console.log('Total heap size (bytes) ${totalHeapSize}, (GB ~${totalHeapSizeInGB}')
Meral
  • 71
  • 4
  • You should try your best to host Node.js apps on non-Windows platforms, if you know iisnode isn't well maintained for years. – Lex Li Feb 09 '23 at 07:27
  • There are fewer support cases related to this issue. Hope these answers can help you. [500 substatus 1013](https://stackoverflow.com/questions/63651224/how-to-solve-error-hresult-0x6d-http-500-substatus-1013-when-deployed-in-azure/63675264#63675264). [Possible permissions issue](https://stackoverflow.com/questions/24028537/iisnode-encountered-an-error-when-processing-the-request). [Increase memory limit](https://stackoverflow.com/questions/65899543/npm-err-enomem-not-enough-memory-read) – TengFeiXie Feb 09 '23 at 10:03

0 Answers0