If I run the following in OS X Sierra (JDK 8u111), it takes 5 seconds to start (unlike milliseconds, for example, Linux):
import java.lang.management.ManagementFactory; import java.lang.management.RuntimeMXBean; public class BeanTest { public static void main (String[] args) { RuntimeMXBean bean = ManagementFactory.getRuntimeMXBean(); System.out.println(bean.getName()); } }
This causes a significant slowdown in the use of libraries whose newer versions call this bit of the management API. My first thought is that this is a DNS problem (the computer is on local home NAT), but my attempt to resolve either the local host name or my local IP address in the shell returns a response (NXDOMAIN) instantly. Running dtruss on a Java process caused these lines to repeat continuously for a 5 second lag:
782/0x36f5: psynch_cvwait(0x7FEE4170B968, 0x20100000300, 0x200) = -1 Err
What is going on here and what can I do to unlock this bottleneck?
source share