private static void handleOOM(Thread t, Throwable e) {
        if (ExceptionUtils.indexOfThrowable(e, OutOfMemoryError.class) != -1) {
            LOGGER.error("Agent exit caused by {} OutOfMemory: ", t.getName(), e);
            forceShutDown();
        }
    }
ThreadUtils, used for handle specified throwable, such as oom, etc.
inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/utils/ThreadUtils.java