Skip to content
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

内存泄漏问题咨询 #3204

Open
lunasaw opened this issue Dec 12, 2024 · 0 comments
Open

内存泄漏问题咨询 #3204

lunasaw opened this issue Dec 12, 2024 · 0 comments
Labels
question Further information is requested

Comments

@lunasaw
Copy link

lunasaw commented Dec 12, 2024

请描述您的问题

询问有关本项目的使用和其他方面的相关问题。
我在使用插件类加载器的时候,插件停止的时候会,清理缓存,

  ObjectWriterProvider writerProvider = JSONFactory.getDefaultObjectWriterProvider();
        ObjectReaderProvider readerProvider = JSONFactory.getDefaultObjectReaderProvider();
        writerProvider.clear();
        readerProvider.clear();

        Map<String, ClassLoader> pluginClassLoaders1 = getPluginClassLoaders();
        pluginClassLoaders1.forEach((k, v) -> {
            log.info("stopPlugins::plugin:{}, classloader:{}", k, v);
            writerProvider.cleanup(v);
            readerProvider.cleanup(v);
        });

如果多次重新加载,在fastjson2会出现Caused by: java.lang.OutOfMemoryError: Metaspace,我该怎么协助排查下呢

com.alibaba.fastjson2.JSONException: create objectReader error, objectType com.weidian.iot.sdk.device.client.model.BaseMessage
       at com.alibaba.fastjson2.reader.ObjectReaderCreatorASM.jitObjectReader(ObjectReaderCreatorASM.java:602)
       at com.alibaba.fastjson2.reader.ObjectReaderCreatorASM.createObjectReader(ObjectReaderCreatorASM.java:327)
       at com.alibaba.fastjson2.reader.ObjectReaderProvider.getObjectReaderInternal(ObjectReaderProvider.java:845)
       at com.alibaba.fastjson2.reader.ObjectReaderProvider.getObjectReader(ObjectReaderProvider.java:763)
       at com.alibaba.fastjson2.JSON.parseObject(JSON.java:858)
       at com.weidian.iot.sdk.device.client.DeviceClient.publishRawMessage(DeviceClient.java:187)
       at com.weidian.iot.sdk.device.client.DeviceClient.reportProperties(DeviceClient.java:231)
       at com.weidian.iot.sdk.device.device.AbstractBridgeDevice.reportProperties(AbstractBridgeDevice.java:119)
       at com.weidian.iot.sdk.device.device.subdevice.AbstractBridgeSubDevice.reportProperties(AbstractBridgeSubDevice.java:114)
       at com.weidian.iot.sdk.device.device.AbstractDevice.firePropertiesChanged(AbstractDevice.java:104)
       at com.weidian.iot.sdk.device.service.DeviceService$1.run(DeviceService.java:344)
       at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
       at java.base/java.util.TimerThread.run(Timer.java:506)
Caused by: java.lang.OutOfMemoryError: Metaspace
@lunasaw lunasaw added the question Further information is requested label Dec 12, 2024
@lunasaw lunasaw changed the title [QUESTION] 内存泄漏问题咨询 内存泄漏问题咨询 Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant