package com.skr.mdm.task;

import io.netty.util.internal.PlatformDependent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class DirectMemoryMonitor {

    @Scheduled(fixedRate = 60 * 1000)
    public void run() {
        log.info("netty堆外内存使用：{}MB", PlatformDependent.usedDirectMemory()/1024/1024);
    }
}
