ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "xubo guo (Jira)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-12979) Peer-class-loading behavior causes the server's metaspace out of memory
Date Sun, 03 May 2020 08:57:00 GMT
xubo guo created IGNITE-12979:

             Summary: Peer-class-loading behavior causes the server's metaspace out of memory
                 Key: IGNITE-12979
                 URL: https://issues.apache.org/jira/browse/IGNITE-12979
             Project: Ignite
          Issue Type: Bug
          Components: clients
    Affects Versions: 2.7.6, 2.7.5, 2.8, 2.7
         Environment: jdk 8 

server set jvm param -XX:MaxMetaspaceSize=512m
            Reporter: xubo guo
             Fix For: None

In Shared mode deployment, peer-class-loading behavior causes the server to run out of memory(metaspace)
if the client starts ,sends compute task, , and often stops. I dump the JVM heap and found
GridDeploymentClassLoader class without unloading.I then debugged it locally and found the
following code in the GridResourceProcessor class, which passed a null value into the ioc.descriptor
method, causing the GridResourceIoc's taskMap property not to store the corresponding information,
which in turn caused the GridResourceIoc's onUndeploy method not to unload the clsDescs corresponding
class information (and possibly other references), which caused OOM.
//ignite 2.8.0  GridResourceProcessor class 261-267 line
private void inject(Object obj,
    GridResourceIoc.AnnotationSet annSet,
    @Nullable GridDeployment dep,
    @Nullable Class<?> depCls,
    Object... params)
    throws IgniteCheckedException {
    GridResourceIoc.ClassDescriptor clsDesc = ioc.descriptor(null, obj.getClass());
Test code:
//client code
public class Task implements IgniteRunnable {

    private int num;

    public Task(int j) {
        this.num = j;

    public void run() {


//client start code
final IgniteConfiguration configuration = new IgniteConfiguration();
for (int i = 0; i < 10000; i++) {
    final Ignite start = Ignition.start(configuration);
    start.compute().run(new Task(i));
 // server -XX:MaxMetaspaceSize=100m
final IgniteConfiguration igniteConfiguration = new IgniteConfiguration(); igniteConfiguration.setPeerClassLoadingEnabled(true);
final Ignite ignite = Ignition.start(igniteConfiguration);

This message was sent by Atlassian Jira

View raw message