【Azure 应用服务】App Service下部署的应用报错 Out of Memory

问题描述

应用部署到App Service后,遇见了Out of Memory的错误。

 

报错信息:GetData  Error:, Exception of type 'System.OutOfMemoryException' was thrown.,

at System.IO.MemoryStream.set_Capacity(Int32 value)

at System.IO.MemoryStream.EnsureCapacity(Int32 value)

at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)

at OfficeOpenXml.Packaging.ZipPackage..ctor(Stream stream)

at OfficeOpenXml.ExcelPackage.ConstructNewFile(String password)

at OfficeOpenXml.ExcelPackage..ctor(FileInfo newFile)

at MyLife.Utility.ExcelHelper.LoadDataTableFromFile(String fileName)

at MyLife.Serivces.GetData()

 

2021-09-12 05:19:57.0362 | Error | HCPService-StartPreprocessing-Exception of type 'System.OutOfMemoryException' was thrown.-

2021-09-12 05:19:57.0756 | Error | An unhandled exception has occurred while executing the request. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

问题解决

面对部署后刚开始启动就出现OOM的错误情况,表示当前定价层的Memroy不足以满足应用的运行。但是App Service不同定价层的内存不同,最低的免费层的RAM为1G,最高可达到14G。

 (Source : https://www.azure.cn/pricing/details/app-service/) 

 

如果排除是定价层的内存限制外,还有一个重要的因素就是App Service的平台设置。

App Service支持32位,64位的平台系统。所以如果默认设置的位32位操作系统,那么它最大只支持4G的内存。为了让应用能使用最大的内存并不让APP Service的RAM资源浪费,当面临OOM的问题时,第一时间修改App Service的平台位数位64位。如果依旧出现OOM的情况,就可以考虑升级App Service的定价层。

 

[END]

 

posted @   路边两盏灯  阅读(225)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示