Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-12979

Peer-class-loading behavior causes the server's metaspace out of memory

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7, 2.8, 2.7.5, 2.7.6
    • None
    • general
    • None
    • jdk 8 

      server set jvm param -XX:MaxMetaspaceSize=512m

    • Docs Required, Release Notes Required

    Description

      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;
          }
      
          @Override
          public void run() {
      
              System.out.println(num);
          }
      }
      
      

       

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

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            tjulaike Guo XuBo

            Dates

              Created:
              Updated:

              Slack

                Issue deployment