监视数据库中的500个表,JVM Metaspace不断上升,最终java.lang.OutOfMemoryError:Metaspce
Describe the bug(Please use English)
I need to create a real-time mirror for the database, so I monitor all the tables in the database (500 tables) .But in the full synchronization phase TaskManager's JVM Metaspace grows growing,finally:java.lang.OutOfMemoryError:Metaspce。
I originally used the default value of Metaspce, which crashed very quickly,about six hours。Then I set up taskmanager.memory.jvm-metaspace.size : 512m,The situation is improved, but it is still collapsed after fourteen hours。I went over the code and found that there was no class-loading leak。
Error message:
java.lang.OutOfMemoryError:Metaspce:This can mean two things: either the job requires a larger size of JVM metaspace to load classes or there is a class loading leak. In the first case 'taskmanager.memory.jvm-metaspace.size' configuration option should be increased. If the error persists (usually in cluster after several job (re-)submissions) then there is probably a class loading leak in user code or some of its dependencies which has to be investigated and fixed. The task executor has to be shutdown...
Environment :
- Flink version : 1.13.6
- Flink CDC version: 2.2.0
- Database and version: mysql 8.0.15
To Reproduce Steps to reproduce the behavior:
- Thes test data :
- The test code :
- The error :
Additional Description
我需要为数据库创建一个实时镜像,所以我监控了数据库中的所有表(500个表)。但是在全同步阶段TaskManager的JVM Metaspace越来越大,最终:java.lang.OutOfMemoryError:Metaspce。
本来我用的是Metaspce的默认值,很快就崩溃了,大概六个小时左右。然后我设置taskmanager.memory.jvm-metaspace.size : 512m,情况有所好转,但是14个小时后还是崩溃了。我去了翻了一遍代码,发现没有类加载泄漏。
错误信息如下所示:
java.lang.OutOfMemoryError:Metaspce:This can mean two things: either the job requires a larger size of JVM metaspace to load classes or there is a class loading leak. In the first case 'taskmanager.memory.jvm-metaspace.size' configuration option should be increased. If the error persists (usually in cluster after several job (re-)submissions) then there is probably a class loading leak in user code or some of its dependencies which has to be investigated and fixed. The task executor has to be shutdown...
你这把内存调大就可以啦
我也遇到了同样的问题,你现在解决了吗
Closing this issue because it was created before version 2.3.0 (2022-11-10). Please try the latest version of Flink CDC to see if the issue has been resolved. If the issue is still valid, kindly report it on Apache Jira under project Flink with component tag Flink CDC. Thank you!