4g

@Component
public class memReaper {
    @PostConstruct
    public void memReaper() {
        long start = System.currentTimeMillis() / 1000;
        List<Map> list = new ArrayList<>();
        while (true) {
            HashMap<String, String> map = new HashMap<>();
            map.put("aaa", "nnnn");
            list.add(map);
            if (list.size() > 3000000) {
                System.out.println("clear");
                list.clear();
            }
            if ((System.currentTimeMillis() / 1000) - start > 1000) {
                return;
            }
        }
    }
}

发表回复

您的电子邮箱地址不会被公开。

Captcha Code