javascript - Kubernetes 集群下 POD 上的无效标记压缩接近堆限制分配失败和 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath
问题描述
我在 K8S 集群上运行微服务,我的一个微服务有 4-6 个 pod。
它不断抛出以下内容:
v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
和:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
我在后端使用 NODE JS。
从谷歌搜索这个问题我发现人们建议这样做
NODE_OPTIONS
--max-old-space-size=8000
但是问题并没有停止,在我的应用程序运行了一段时间(20-30 分钟)并且 pod 开始工作后,内存开始增加,直到达到我专用于 POD 的最大值(8GB)和然后是重新启动。
为什么这仍然发生?为什么--max-old-space-size=8192
不解决堆问题?
解决方案
推荐阅读
- gruntjs - 用 grunt-browserify 打包
- python - 建立新连接失败,找不到满足要求的版本soupsieve Beautiful Soup
- visual-studio - VS 2019有没有办法停用所有断点?
- flutter - 是否可以在 Flutter Navigator 中添加中间件?
- python - Pandas 从 B 列替换 A 列中的 NaN
- asp.net-mvc - 在查询字符串中使用运算符进行 EF Core 搜索
- php - 尝试清除 FilesystemCache 后,我的应用程序继续加载
- java - 将任何集合变形为地图
- django - 无法理解 django csrf 豁免 cbv 的代码
- php - cURL 错误 7:无法连接到 logging.googleapis.com 端口 443:连接超时