code: public static void register(Object object, Runnable cleanupTask) {
          AutomaticCleanerReference reference = new AutomaticCleanerReference(object,
                  ObjectUtil.checkNotNull(cleanupTask, "cleanupTask"));
          // Its important to add the reference to the LIVE_SET before we access CLEANER_RUNNING to ensure correct
          // behavior in multi-threaded environments.
          LIVE_SET.add(reference);
  
          // Check if there is already a cleaner running.
          if (CLEANER_RUNNING.compareAndSet(false, true)) {
              final Thread cleanupThread = new FastThreadLocalThread(CLEANER_TASK);
              cleanupThread.setPriority(Thread.MIN_PRIORITY);
              // Set to null to ensure we not create classloader leaks by holding a strong reference to the inherited
              // classloader.
              // See:
              // - https://github.com/netty/netty/issues/7290
              // - https://bugs.openjdk.java.net/browse/JDK-7008595
              AccessController.doPrivileged(new PrivilegedAction<Void>() {
                  @Override
                  public Void run() {
                      cleanupThread.setContextClassLoader(null);
                      return null;
                  }
              });
              cleanupThread.setName(CLEANER_THREAD_NAME);
  
              // Mark this as a daemon thread to ensure that we the JVM can exit if this is the only thread that is
              // running.
              cleanupThread.setDaemon(true);
              cleanupThread.start();
          }
      }
docs: Register the given {@link Object} for which the {@link Runnable} will be executed once there are no references
  to the object anymore.
  
  This should only be used if there are no other ways to execute some cleanup once the Object is not reachable
  anymore because it is not a cheap way to handle the cleanup.