Skip to content

[BUG] 2.0.57 类似com.alibaba.fastjson2.writer.OWG_20180_7_Filtering的动态类持续增长,导致metaspace OOM #3564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Levin-Li opened this issue May 18, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@Levin-Li
Copy link

问题描述

简要描述您碰到的问题。

环境信息

请填写以下信息:

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

重现步骤

如何操作可以重现该问题:

  1. 使用 xxx.xxx 方法
  2. 输入 ... 数据
  3. 出现 ... 错误
//可在此输入示例代码

期待的正确结果

对您期望发生的结果进行清晰简洁的描述。

相关日志输出

请复制并粘贴任何相关的日志输出。

附加信息

如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。

@Levin-Li Levin-Li added the bug Something isn't working label May 18, 2025
@yanxutao89
Copy link
Collaborator

麻烦提供一下可复现的示例代码

@Levin-Li
Copy link
Author

//如果原来就是json对象
if (source instanceof CharSequence
|| source instanceof JsonElement
|| source instanceof com.alibaba.fastjson2.JSONObject
|| source instanceof com.alibaba.fastjson.JSON
|| source instanceof cn.hutool.json.JSONObject) {
return source.toString();
}

我都代码很简单了,很多人提了这个, 问题,动态类定义持续增长的问题 . 不一定是filter 类, 还有其他类

@Levin-Li
Copy link
Author

一个晚上 会涨的5万多,基本上2天就OOM
[bcm@iZt4n1dc2rmlt3xnb0wl7aZ api_admin_8080]$ ./jcmd.sh GC.class_stats |grep '.fastjson2.'|grep '_Filter'| wc -l
55151

@wenshao
Copy link
Member

wenshao commented May 22, 2025

有个Filtering的类,可以提供类结构信息么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants