fastjson2 icon indicating copy to clipboard operation
fastjson2 copied to clipboard

[BUG]在使用JSON.toJSONString序列化对象时出现OutOfMemoryError: Metaspace

Open cbib-guoguifang opened this issue 1 year ago • 1 comments

问题描述

在生产环境打印较多日志时使用JSON.toJSONString序列化对象时会出现OutOfMemoryError: Metaspace

环境信息

请填写以下信息:

  • OS信息: [e.g.:CentOS 8.4.2105 4Core 3.10GHz 16 GB]
  • JDK信息: [e.g.:Openjdk 1.8.0_312]
  • 版本信息:[e.g.:Fastjson2 2.0.38]

重现步骤

调用JSON.toJSONString方法

附加信息

企业微信截图_d86bd2f0-311e-4fef-8d7d-ca1355ed05b6

cbib-guoguifang avatar Aug 30 '23 02:08 cbib-guoguifang

遇到同样问题,用arthas分析了一下com.alibaba.fastjson2.util.DynamicClassLoader这个类加载器加载的类持续累积不释放,导致Metaspace泄露,配置了MaxMetaspace也不会触发回收

scuhanbin avatar Feb 21 '24 01:02 scuhanbin