You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Node.js与IIS部署共存时的内存问题排查求助

Node.js(Express)应用部署到IIS后数据库连接时出现内存问题

之前Node.js(Express)应用在PM2上运行一切正常,迁移至IIS并完成全部配置后,应用仅能正常处理静态页面,连接数据库获取数据时出现内存问题,报错截图如下:
内存报错截图

经排查,报错出自以下代码片段:

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

尝试增大堆内存大小,但问题仍未解决,相关代码如下:

'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}')

现寻求该内存问题的解决方法。

内容的提问来源于stack exchange,提问作者Meral

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 00:31:14