while (true) { try { // ... } catch (Throwable t) { // 防止在一个loop中频繁抛异常导致CPU占用飙升 Thread.sleep(1000); } }