Java中LockSupport.parkNanos与Sleep的区别是什么? 20C

Java中LockSupport.parkNanos与Sleep都可以使当前线程阻塞指定时间,那么除了是否抛出interrupt异常以外,这两者的区别是什么呢?在JVM中两者对于CPU的调度有区别吗?在实际使用中,是推荐使用LockSupport.parkNanos还是Sleep呢?

1个回答

为什么比较这两个呢?先简单说下区别,其它的你可以自行度娘一下这两个的原理就明白 了。
LockSupport中的park() 和 unpark() 的作用分别是阻塞线程和解除阻塞线程,而且park()和unpark()不会遇到“Thread.suspend 和 Thread.resume所可能引发的死锁”问题。因为park() 和 unpark()有许可的存在;调用 park() 的线程和另一个试图将其 unpark() 的线程之间的竞争将保持活性。实现原理是利用java的unsafe接口调用本地方法实现。
Sleep()是单纯的在指定时间内让当前正在执行的线程暂停执行,但不会释放“锁标志”,使当前线程进入阻塞状态,在指定时间内不会执行。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Springboot刚启动就报内存溢出?
1.问题描述: 本地系统是Ubuntu,jdk1.8,工具是eclipse,新创建的最简单的springboot项目,其中只导入了web、config的包。 只写了一个controller,启动就会报错。 Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.201-b09 mixed mode): "DestroyJavaVM" #39 prio=5 os_prio=0 tid=0x00007f0ae800f000 nid=0x697c waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "http-nio-8080-Acceptor-0" #37 daemon prio=5 os_prio=0 tid=0x00007f0ae8224800 nid=0x69ae runnable [0x00007f0ac26ed000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method) at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:422) at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:250) - locked <0x000000076f448c40> (a java.lang.Object) at org.apache.tomcat.util.net.NioEndpoint.serverSocketAccept(NioEndpoint.java:448) at org.apache.tomcat.util.net.NioEndpoint.serverSocketAccept(NioEndpoint.java:70) at org.apache.tomcat.util.net.Acceptor.run(Acceptor.java:95) at java.lang.Thread.run(Thread.java:748) "http-nio-8080-ClientPoller-1" #36 daemon prio=5 os_prio=0 tid=0x00007f0ae821f000 nid=0x69ad runnable [0x00007f0ac27ee000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method) at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269) at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93) at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86) - locked <0x000000076f5c05c0> (a sun.nio.ch.Util$3) - locked <0x000000076f5c05b0> (a java.util.Collections$UnmodifiableSet) - locked <0x000000076f5c0498> (a sun.nio.ch.EPollSelectorImpl) at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97) at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:743) at java.lang.Thread.run(Thread.java:748) "http-nio-8080-ClientPoller-0" #35 daemon prio=5 os_prio=0 tid=0x00007f0ae821d000 nid=0x69ac runnable [0x00007f0ac28ef000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method) at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269) at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93) at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86) - locked <0x000000076f5afb78> (a sun.nio.ch.Util$3) - locked <0x000000076f5afb68> (a java.util.Collections$UnmodifiableSet) - locked <0x000000076f5afa50> (a sun.nio.ch.EPollSelectorImpl) at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97) at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:743) at java.lang.Thread.run(Thread.java:748) "http-nio-8080-exec-10" #34 daemon prio=5 os_prio=0 tid=0x00007f0ae82b5800 nid=0x69ab waiting on condition [0x00007f0ac29f0000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000076f59e010> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:107) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:33) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) "http-nio-8080-exec-9" #33 daemon prio=5 os_prio=0 tid=0x00007f0ae82b4000 nid=0x69aa waiting on condition [0x00007f0ac2af1000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000076f59e010> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:107) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:33) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) "http-nio-8080-exec-8" #32 daemon prio=5 os_prio=0 tid=0x00007f0ae82b2000 nid=0x69a9 waiting on condition [0x00007f0ac2bf2000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000076f59e010> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:107) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:33) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) "http-nio-8080-exec-7" #31 daemon prio=5 os_prio=0 tid=0x00007f0ae82b0000 nid=0x69a8 waiting on condition [0x00007f0ac2cf3000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000076f59e010> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:107) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:33) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) "http-nio-8080-exec-6" #30 daemon prio=5 os_prio=0 tid=0x00007f0ae82ae000 nid=0x69a7 waiting on condition [0x00007f0ac2df4000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000076f59e010> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:107) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:33) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) "http-nio-8080-exec-5" #29 daemon prio=5 os_prio=0 tid=0x00007f0ae8256800 nid=0x69a6 waiting on condition [0x00007f0ac2ef5000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000076f59e010> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:107) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:33) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) "http-nio-8080-exec-4" #28 daemon prio=5 os_prio=0 tid=0x00007f0ae8254800 nid=0x69a5 waiting on condition [0x00007f0ac2ff6000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000076f59e010> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:107) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:33) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) "http-nio-8080-exec-3" #27 daemon prio=5 os_prio=0 tid=0x00007f0ae8252800 nid=0x69a4 waiting on condition [0x00007f0ac30f7000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000076f59e010> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:107) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:33) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) "http-nio-8080-exec-2" #26 daemon prio=5 os_prio=0 tid=0x00007f0ae8251000 nid=0x69a3 waiting on condition [0x00007f0ac31f8000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000076f59e010> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:107) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:33) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) "http-nio-8080-exec-1" #25 daemon prio=5 os_prio=0 tid=0x00007f0ae824f800 nid=0x69a2 waiting on condition [0x00007f0ac32f9000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000076f59e010> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:107) at org.apache.tomcat.util.threads.TaskQueue.take(TaskQueue.java:33) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) "NioBlockingSelector.BlockPoller-1" #24 daemon prio=5 os_prio=0 tid=0x00007f0ae82e3800 nid=0x69a1 runnable [0x00007f0ac33fa000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method) at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269) at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:93) at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86) - locked <0x000000076f44a298> (a sun.nio.ch.Util$3) - locked <0x000000076f44a210> (a java.util.Collections$UnmodifiableSet) - locked <0x000000076f44a090> (a sun.nio.ch.EPollSelectorImpl) at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:97) at org.apache.tomcat.util.net.NioBlockingSelector$BlockPoller.run(NioBlockingSelector.java:304) "spring.cloud.inetutils" #23 daemon prio=5 os_prio=0 tid=0x00007f0ae82fb800 nid=0x69a0 waiting on condition [0x00007f0ac34fb000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x000000076e593b10> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) "SimplePauseDetectorThread_0" #22 daemon prio=9 os_prio=0 tid=0x00007f0a84015000 nid=0x699f waiting on condition [0x00007f0ac37fc000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at java.lang.Thread.sleep(Thread.java:340) at java.util.concurrent.TimeUnit.sleep(TimeUnit.java:386) at org.LatencyUtils.TimeServices.sleepNanos(TimeServices.java:62) at org.LatencyUtils.SimplePauseDetector$SimplePauseDetectorThread.run(SimplePauseDetector.java:116) "Thread-4" #21 daemon prio=9 os_prio=0 tid=0x00007f0a84011800 nid=0x699e waiting on condition [0x00007f0ac38fd000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00000006c7b7a928> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442) at org.LatencyUtils.PauseDetector$PauseDetectorThread.run(PauseDetector.java:85) "container-0" #20 prio=5 os_prio=0 tid=0x00007f0ae8c72800 nid=0x699d waiting on condition [0x00007f0ac39fe000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at org.apache.catalina.core.StandardServer.await(StandardServer.java:568) at org.springframework.boot.web.embedded.tomcat.TomcatWebServer$1.run(TomcatWebServer.java:181) "Catalina-utility-2" #19 prio=1 os_prio=0 tid=0x00007f0a68314800 nid=0x699c waiting on condition [0x00007f0ac8dfd000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00000006c7ab4300> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1088) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) "Catalina-utility-1" #18 prio=1 os_prio=0 tid=0x00007f0ae8c6a800 nid=0x699b waiting on condition [0x00007f0ad0143000] java.lang.Thread.State: TIMED_WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00000006c7ab4300> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) "RMI TCP Accept-0" #13 daemon prio=5 os_prio=0 tid=0x00007f0ae850a000 nid=0x6995 runnable [0x00007f0ad056d000] java.lang.Thread.State: RUNNABLE at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409) at java.net.ServerSocket.implAccept(ServerSocket.java:545) at java.net.ServerSocket.accept(ServerSocket.java:513) at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:52) at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:405) at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:377) at java.lang.Thread.run(Thread.java:748) "RMI TCP Accept-43459" #12 daemon prio=5 os_prio=0 tid=0x00007f0ae84ca000 nid=0x6994 runnable [0x00007f0ad0694000] java.lang.Thread.State: RUNNABLE at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409) at java.net.ServerSocket.implAccept(ServerSocket.java:545) at java.net.ServerSocket.accept(ServerSocket.java:513) at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:405) at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:377) at java.lang.Thread.run(Thread.java:748) "RMI TCP Accept-0" #11 daemon prio=5 os_prio=0 tid=0x00007f0ae84b5000 nid=0x6993 runnable [0x00007f0ad0795000] java.lang.Thread.State: RUNNABLE at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:409) at java.net.ServerSocket.implAccept(ServerSocket.java:545) at java.net.ServerSocket.accept(ServerSocket.java:513) at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:405) at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:377) at java.lang.Thread.run(Thread.java:748) "Service Thread" #9 daemon prio=9 os_prio=0 tid=0x00007f0ae80d8000 nid=0x6992 runnable [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C1 CompilerThread3" #8 daemon prio=9 os_prio=0 tid=0x00007f0ae80cc800 nid=0x6991 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C2 CompilerThread2" #7 daemon prio=9 os_prio=0 tid=0x00007f0ae80ca800 nid=0x6990 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C2 CompilerThread1" #6 daemon prio=9 os_prio=0 tid=0x00007f0ae80c9000 nid=0x698f waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C2 CompilerThread0" #5 daemon prio=9 os_prio=0 tid=0x00007f0ae80c6000 nid=0x698e waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "Signal Dispatcher" #4 daemon prio=9 os_prio=0 tid=0x00007f0ae80c4800 nid=0x698d waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "Finalizer" #3 daemon prio=8 os_prio=0 tid=0x00007f0ae8091800 nid=0x698c in Object.wait() [0x00007f0ad26de000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x00000006c701d718> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144) - locked <0x00000006c701d718> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:165) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:216) "Reference Handler" #2 daemon prio=10 os_prio=0 tid=0x00007f0ae808f000 nid=0x698b in Object.wait() [0x00007f0ad27df000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x00000006c7034928> (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(Object.java:502) at java.lang.ref.Reference.tryHandlePending(Reference.java:191) - locked <0x00000006c7034928> (a java.lang.ref.Reference$Lock) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153) "VM Thread" os_prio=0 tid=0x00007f0ae8085800 nid=0x698a runnable "GC task thread#0 (ParallelGC)" os_prio=0 tid=0x00007f0ae8025000 nid=0x6980 runnable "GC task thread#1 (ParallelGC)" os_prio=0 tid=0x00007f0ae8026800 nid=0x6981 runnable "GC task thread#2 (ParallelGC)" os_prio=0 tid=0x00007f0ae8028800 nid=0x6982 runnable "GC task thread#3 (ParallelGC)" os_prio=0 tid=0x00007f0ae802a000 nid=0x6983 runnable "GC task thread#4 (ParallelGC)" os_prio=0 tid=0x00007f0ae802c000 nid=0x6984 runnable "GC task thread#5 (ParallelGC)" os_prio=0 tid=0x00007f0ae802d800 nid=0x6987 runnable "GC task thread#6 (ParallelGC)" os_prio=0 tid=0x00007f0ae802f800 nid=0x6988 runnable "GC task thread#7 (ParallelGC)" os_prio=0 tid=0x00007f0ae8031000 nid=0x6989 runnable "VM Periodic Task Thread" os_prio=0 tid=0x00007f0ae850c000 nid=0x6996 waiting on condition JNI global references: 1235 Heap PSYoungGen total 144384K, used 45005K [0x000000076d000000, 0x0000000777b00000, 0x00000007c0000000) eden space 126976K, 35% used [0x000000076d000000,0x000000076fbf3608,0x0000000774c00000) from space 17408K, 0% used [0x0000000775d00000,0x0000000775d00000,0x0000000776e00000) to space 17408K, 0% used [0x0000000774c00000,0x0000000774c00000,0x0000000775d00000) ParOldGen total 175616K, used 22110K [0x00000006c7000000, 0x00000006d1b80000, 0x000000076d000000) object space 175616K, 12% used [0x00000006c7000000,0x00000006c85978a8,0x00000006d1b80000) Metaspace used 35192K, capacity 37248K, committed 37504K, reserved 1081344K class space used 4819K, capacity 5214K, committed 5248K, reserved 1048576K 2019-04-01 14:22:57.992 INFO 27001 --- [on(2)-127.0.0.1] inMXBeanRegistrar$SpringApplicationAdmin : Application shutdown requested. 2019-04-01 14:22:57.994 INFO 27001 --- [on(2)-127.0.0.1] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' 2019-04-01 14:22:58.004 INFO 27001 --- [on(2)-127.0.0.1] o.apache.catalina.core.StandardService : Stopping service [Tomcat] ``` ```
top+jstack解决java项目cpu高的问题,求助。
项目是servlet,用了hibernate,redis。压力测试发现单核cpu占用300%左右。 top命令然后ps -mp 32396 -o THREAD,tid,time 发现有很多和pid32396相似的tid 大概tid都是32200-32400,每个tid占用cpu在0.7%-2.5%,然后用jstack 32396 | grep <tid> -A 100 ,各线程堆栈如 [root@localhost bin]# jstack 22887|grep 5b63 -A 100 "catalina-exec-363" daemon prio=10 tid=0x00002aaab44df800 nid=0x5b63 waiting on condition [0x000000005a2fa000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at com.dascom.wanbu.service.IWanbuService.doGet(IWanbuService.java:74) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288) - locked <0x00000007e323c640> (a org.apache.tomcat.util.net.SocketWrapper) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) "catalina-exec-362" daemon prio=10 tid=0x00002aaab8092800 nid=0x5b62 waiting on condition [0x000000005a1f9000] java.lang.Thread.State: TIMED_WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x0000000780192798> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025) at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:424) at org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:86) at org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:32) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) at java.lang.Thread.run(Thread.java:662) "catalina-exec-361" daemon prio=10 tid=0x00002aaab8091000 nid=0x5b61 runnable [0x000000005a0f7000] java.lang.Thread.State: RUNNABLE at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113) at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160) at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188) - locked <0x00000007b7926608> (a com.mysql.jdbc.util.ReadAheadInputStream) at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2329) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2774) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2763) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3299) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1837) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2537) - locked <0x00000007b7932890> (a java.lang.Object) at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:4836) - locked <0x00000007b7932890> (a java.lang.Object) at com.mchange.v2.c3p0.impl.NewProxyConnection.setAutoCommit(NewProxyConnection.java:1085) - locked <0x00000007e424c328> (a com.mchange.v2.c3p0.impl.NewProxyConnection) at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:83) at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446) at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167) at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161) at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1577) at org.hibernate.loader.Loader.doQuery(Loader.java:696) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259) at org.hibernate.loader.Loader.doList(Loader.java:2232) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129) at org.hibernate.loader.Loader.list(Loader.java:2124) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1723) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175) at com.dascom.wanbu.Im.BaseActiveDaoIm.getGroupName(BaseActiveDaoIm.java:483) at com.dascom.wanbu.Im.BaseActiveDaoIm.getGroupInfoByPath(BaseActiveDaoIm.java:612) at com.dascom.wanbu.actionManager.RedisAction.GetPathByActiveIDAndGroupIDAction.GetPathByActiveIDAndGroupID(GetPathByActiveIDAndGroupIDAction.java:46) at com.dascom.wanbu.service.BaseDataService_Dispatcher.BaseDataService_Dispatcher.ReqDataManager(BaseDataService_Dispatcher.java:86) at com.dascom.wanbu.service.activeservice.im.ActiveRank_Service_Im.GetPathByActiveIDAndGroupID(ActiveRank_Service_Im.java:49) at com.dascom.wanbu.service.IWanbuService.doGet(IWanbuService.java:88) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:306) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:541) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:383) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:166) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:288) - locked <0x00000007dfc1ce38> (a org.apache.tomcat.util.net.SocketWrapper) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) 下:,各位大神给指条明路,感谢。
Android 发生ANR时候在traces根本发现不了哪里错了,求解答
# App里面Log日志报的ANR错: 11-09 16:46:42.739: E/ActivityManager(1309): ANR in com.dingdingpai.paybox (com.dingdingpai.paybox/com.zftpay.paybox.activity.acquirer.nearby.NearByPaySucAct) 11-09 16:46:42.739: E/ActivityManager(1309): PID: 28531 11-09 16:46:42.739: E/ActivityManager(1309): Reason: Input dispatching timed out (Waiting because the touched window has not finished processing the input events that were previously delivered to it.) 11-09 16:46:42.739: E/ActivityManager(1309): Load: 19.43 / 18.81 / 18.84 11-09 16:46:42.739: E/ActivityManager(1309): CPU usage from 36891ms to 0ms ago with 99% awake: 11-09 16:46:42.739: E/ActivityManager(1309): 86% 28531/com.dingdingpai.paybox: 82% user + 3.9% kernel / faults: 179 minor 29 major 11-09 16:46:42.739: E/ActivityManager(1309): 2% 406/adbd: 0.1% user + 1.9% kernel / faults: 1549 minor 11-09 16:46:42.739: E/ActivityManager(1309): 1.1% 213/mediaserver: 0% user + 1.1% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0.9% 1695/android.process.media: 0.4% user + 0.4% kernel / faults: 1 minor 11-09 16:46:42.739: E/ActivityManager(1309): 0.8% 1309/system_server: 0.5% user + 0.2% kernel / faults: 853 minor 36 major 11-09 16:46:42.739: E/ActivityManager(1309): 0.6% 2623/mpdecision: 0% user + 0.6% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0.4% 20721/kworker/0:2H: 0% user + 0.4% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0.4% 1457/com.android.systemui: 0.2% user + 0.1% kernel / faults: 1467 minor 532 major 11-09 16:46:42.739: E/ActivityManager(1309): 0.3% 127/w1_bus_master1: 0% user + 0.3% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0.2% 25402/com.xiaomi.gamecenter: 0% user + 0.2% kernel / faults: 4 minor 1 major 11-09 16:46:42.739: E/ActivityManager(1309): 0.1% 1784/com.android.phone: 0.1% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0.1% 2248/com.miui.securitycenter.remote: 0.1% user + 0% kernel / faults: 1244 minor 96 major 11-09 16:46:42.739: E/ActivityManager(1309): 0.1% 25659/kworker/0:3H: 0% user + 0.1% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0.1% 3/ksoftirqd/0: 0% user + 0.1% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0.1% 30244/kworker/0:2: 0% user + 0.1% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 7/kworker/u:0H: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 26627/logcat: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 30827/kworker/u:4: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 155/mmcqd/0: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 200/servicemanager: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 210/surfaceflinger: 0% user + 0% kernel / faults: 1 minor 1 major 11-09 16:46:42.739: E/ActivityManager(1309): 0% 402/thermal-engine: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 13894/wpa_supplicant: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 30833/kworker/u:12: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 2/kthreadd: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 33/kworker/u:1H: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 222/qrngd: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 336/sdcard: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 400/location-mq: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 821/mdss_fb0: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 1741/com.sohu.inputmethod.sogou.xiaomi: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 1827/com.miui.whetstone: 0% user + 0% kernel / faults: 4 minor 11-09 16:46:42.739: E/ActivityManager(1309): 0% 1860/com.miui.home: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 2138/com.miui.powerkeeper:service: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 2226/com.miui.networkassistant.deamon: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 2590/mcd: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 2957/sogou.mobile.explorer.hotwords: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 13881/MC_Thread: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 0% 13883/RX_Thread: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): +0% 31241/migration/1: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): +0% 31242/kworker/1:0: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): +0% 31243/kworker/1:0H: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): +0% 31244/ksoftirqd/1: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): +0% 31254/kworker/1:1: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): +0% 31433/kworker/1:1H: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): +0% 31434/kworker/0:1H: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): +0% 31437/kworker/1:2H: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 55% TOTAL: 49% user + 6% kernel + 0% iowait + 0% softirq 11-09 16:46:42.739: E/ActivityManager(1309): CPU usage from 2259ms to 2795ms later: 11-09 16:46:42.739: E/ActivityManager(1309): 108% 28531/com.dingdingpai.paybox: 107% user + 1.7% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 16% 30950/Thread-1615: 16% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 14% 31058/Thread-1623: 14% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 14% 31096/Thread-1627: 14% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 14% 31176/Thread-1631: 12% user + 1.7% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 12% 30866/Thread-1612: 12% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 12% 31043/Thread-1621: 12% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 12% 31089/Thread-1625: 12% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 12% 31119/Thread-1629: 12% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 1.7% 28554/FileObserver: 1.7% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 7.2% 1309/system_server: 5.4% user + 1.8% kernel / faults: 1 minor 11-09 16:46:42.739: E/ActivityManager(1309): 7.2% 1338/ActivityManager: 3.6% user + 3.6% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 1.8% 213/mediaserver: 0% user + 1.8% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 1.8% 406/adbd: 0% user + 1.8% kernel / faults: 32 minor 11-09 16:46:42.739: E/ActivityManager(1309): 1.8% 406/adbd: 0% user + 1.8% kernel 11-09 16:46:42.739: E/ActivityManager(1309): +0% 31531/adbd: 0% user + 0% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 1.3% 31244/ksoftirqd/1: 0% user + 1.3% kernel 11-09 16:46:42.739: E/ActivityManager(1309): 43% TOTAL: 39% user + 3.4% kernel # 然后我在traces文件里面去找PID: 28531的根本发现不了什么错 # 单独拉出来PID=28531的拉出来如下: "Thread-1633" prio=5 tid=1 VMWAIT | group="main" sCount=1 dsCount=0 obj=0x42b18010 self=0x416f4860 | sysTid=28531 nice=0 sched=0/0 cgrp=apps handle=1074823508 | state=S schedstat=( 23570772482 18096225770 108042 ) utm=1866 stm=491 core=0 #00 pc 00021a98 /system/lib/libc.so (__futex_syscall3+8) #01 pc 0000f034 /system/lib/libc.so (__pthread_cond_timedwait_relative+48) #02 pc 0000f094 /system/lib/libc.so (__pthread_cond_timedwait+64) #03 pc 0004d663 /system/lib/libdvm.so #04 pc 0003cd0d /system/lib/libdvm.so #05 pc 0004f255 /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*, bool)+420) #06 pc 00001063 /system/bin/app_process #07 pc 0000e4bb /system/lib/libc.so (__libc_init+50) #08 pc 00000d80 /system/bin/app_process at dalvik.system.NativeStart.run(Native Method) # 但是根本不知道是哪里报错了啊,好纠结啊,用了腾讯的bugly也根本不行啊,有点崩溃,哪位大神给看下到底出错了啊,拜谢 # 下面是pid=28531的全部traces日志: ----- pid 28531 at 2016-11-09 16:46:39 ----- Cmd line: com.dingdingpai.paybox JNI: CheckJNI is off; workarounds are off; pins=1; globals=498 DALVIK THREADS: (mutexes: tll=0 tsl=0 tscl=0 ghl=0) "Thread-1631" prio=5 tid=26 TIMED_WAIT | group="main" sCount=1 dsCount=0 obj=0x42b0e968 self=0x62c1cec8 | sysTid=31176 nice=0 sched=0/0 cgrp=apps handle=1656772904 | state=S schedstat=( 3633299697 1606457029 4432 ) utm=337 stm=26 core=1 at java.lang.VMThread.sleep(Native Method) at java.lang.Thread.sleep(Thread.java:1013) at java.lang.Thread.sleep(Thread.java:995) at com.zftpay.paybox.widget.customsialog.LoadingDialogView$UpdataThread.run(LoadingDialogView.java:111) at java.lang.Thread.run(Thread.java:841) "Thread-1633" prio=5 tid=1 VMWAIT | group="main" sCount=1 dsCount=0 obj=0x42b18010 self=0x416f4860 | sysTid=28531 nice=0 sched=0/0 cgrp=apps handle=1074823508 | state=S schedstat=( 23570772482 18096225770 108042 ) utm=1866 stm=491 core=0 #00 pc 00021a98 /system/lib/libc.so (__futex_syscall3+8) #01 pc 0000f034 /system/lib/libc.so (__pthread_cond_timedwait_relative+48) #02 pc 0000f094 /system/lib/libc.so (__pthread_cond_timedwait+64) #03 pc 0004d663 /system/lib/libdvm.so #04 pc 0003cd0d /system/lib/libdvm.so #05 pc 0004f255 /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*, bool)+420) #06 pc 00001063 /system/bin/app_process #07 pc 0000e4bb /system/lib/libc.so (__libc_init+50) #08 pc 00000d80 /system/bin/app_process at dalvik.system.NativeStart.run(Native Method) "Thread-1629" prio=5 tid=34 SUSPENDED | group="main" sCount=1 dsCount=0 obj=0x424ef5a0 self=0x61f39890 | sysTid=31119 nice=0 sched=0/0 cgrp=apps handle=1621144376 | state=S schedstat=( 3689865326 1726587225 4851 ) utm=343 stm=25 core=1 #00 pc 00021a98 /system/lib/libc.so (__futex_syscall3+8) #01 pc 0000f034 /system/lib/libc.so (__pthread_cond_timedwait_relative+48) #02 pc 0000f094 /system/lib/libc.so (__pthread_cond_timedwait+64) #03 pc 0005655f /system/lib/libdvm.so #04 pc 00056b21 /system/lib/libdvm.so (dvmChangeStatus(Thread*, ThreadStatus)+34) #05 pc 00055c81 /system/lib/libdvm.so #06 pc 00055ce7 /system/lib/libdvm.so (dvmThreadSleep(unsigned long long, unsigned int)+62) #07 pc 00000214 /dev/ashmem/dalvik-jit-code-cache (deleted) at java.lang.VMThread.sleep(Native Method) at java.lang.Thread.sleep(Thread.java:1013) at java.lang.Thread.sleep(Thread.java:995) at com.zftpay.paybox.widget.customsialog.LoadingDialogView$UpdataThread.run(LoadingDialogView.java:111) at java.lang.Thread.run(Thread.java:841) "Thread-1627" prio=5 tid=33 MONITOR | group="main" sCount=1 dsCount=0 obj=0x428e4638 self=0x61f1c890 | sysTid=31096 nice=0 sched=0/0 cgrp=apps handle=1643236584 | state=S schedstat=( 3674041640 1764672973 5137 ) utm=332 stm=35 core=1 at android.os.MessageQueue.enqueueMessage(MessageQueue.java:~318) - waiting to lock <0x4244ee90> (a android.os.MessageQueue) held by tid=30 (Thread-1623) at android.os.Handler.enqueueMessage(Handler.java:626) at android.os.Handler.sendMessageAtTime(Handler.java:595) at android.os.Handler.sendMessageDelayed(Handler.java:566) at android.os.Handler.sendEmptyMessageDelayed(Handler.java:530) at android.os.Handler.sendEmptyMessage(Handler.java:515) at com.zftpay.paybox.widget.customsialog.LoadingDialogView$UpdataThread.run(LoadingDialogView.java:112) at java.lang.Thread.run(Thread.java:841) "Thread-1625" prio=5 tid=32 MONITOR | group="main" sCount=1 dsCount=0 obj=0x424e1200 self=0x61ee9860 | sysTid=31089 nice=0 sched=0/0 cgrp=apps handle=1643027640 | state=S schedstat=( 3708275048 1726739259 5283 ) utm=337 stm=33 core=1 at android.os.MessageQueue.enqueueMessage(MessageQueue.java:~318) - waiting to lock <0x4244ee90> (a android.os.MessageQueue) held by tid=30 (Thread-1623) at android.os.Handler.enqueueMessage(Handler.java:626) at android.os.Handler.sendMessageAtTime(Handler.java:595) at android.os.Handler.sendMessageDelayed(Handler.java:566) at android.os.Handler.sendEmptyMessageDelayed(Handler.java:530) at android.os.Handler.sendEmptyMessage(Handler.java:515) at com.zftpay.paybox.widget.customsialog.LoadingDialogView$UpdataThread.run(LoadingDialogView.java:112) at java.lang.Thread.run(Thread.java:841) "Thread-1623" prio=5 tid=30 SUSPENDED | group="main" sCount=1 dsCount=0 obj=0x426c2158 self=0x62c222b8 | sysTid=31058 nice=0 sched=0/0 cgrp=apps handle=1656829440 | state=S schedstat=( 3700224020 1786775127 5578 ) utm=344 stm=26 core=1 at android.os.MessageQueue.enqueueMessage(MessageQueue.java:~343) at android.os.Handler.enqueueMessage(Handler.java:626) at android.os.Handler.sendMessageAtTime(Handler.java:595) at android.os.Handler.sendMessageDelayed(Handler.java:566) at android.os.Handler.sendEmptyMessageDelayed(Handler.java:530) at android.os.Handler.sendEmptyMessage(Handler.java:515) at com.zftpay.paybox.widget.customsialog.LoadingDialogView$UpdataThread.run(LoadingDialogView.java:112) at java.lang.Thread.run(Thread.java:841) "Thread-1621" prio=5 tid=29 MONITOR | group="main" sCount=1 dsCount=0 obj=0x42b37f08 self=0x62c5c1d0 | sysTid=31043 nice=0 sched=0/0 cgrp=apps handle=1621199688 | state=S schedstat=( 3730750307 1943187029 5817 ) utm=347 stm=26 core=1 at android.os.MessageQueue.enqueueMessage(MessageQueue.java:~318) - waiting to lock <0x4244ee90> (a android.os.MessageQueue) held by tid=30 (Thread-1623) at android.os.Handler.enqueueMessage(Handler.java:626) at android.os.Handler.sendMessageAtTime(Handler.java:595) at android.os.Handler.sendMessageDelayed(Handler.java:566) at android.os.Handler.sendEmptyMessageDelayed(Handler.java:530) at android.os.Handler.sendEmptyMessage(Handler.java:515) at com.zftpay.paybox.widget.customsialog.LoadingDialogView$UpdataThread.run(LoadingDialogView.java:112) at java.lang.Thread.run(Thread.java:841) "AudioRecord" prio=10 tid=28 NATIVE | group="main" sCount=1 dsCount=0 obj=0x424969d0 self=0x62c207d0 | sysTid=30963 nice=-16 sched=0/0 cgrp=apps handle=1621178400 | state=S schedstat=( 4357705 17892868 76 ) utm=0 stm=0 core=0 #00 pc 00021a9c /system/lib/libc.so (__futex_syscall3+12) #01 pc 0000f034 /system/lib/libc.so (__pthread_cond_timedwait_relative+48) #02 pc 00051bbd /system/lib/libmedia.so (android::AudioRecord::AudioRecordThread::threadLoop()+100) #03 pc 0000ea4d /system/lib/libutils.so (android::Thread::_threadLoop(void*)+104) #04 pc 0004e485 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+68) #05 pc 0000e5ef /system/lib/libutils.so #06 pc 0000d240 /system/lib/libc.so (__thread_entry+72) #07 pc 0000d3d8 /system/lib/libc.so (pthread_create+240) at dalvik.system.NativeStart.run(Native Method) "Thread-1615" prio=5 tid=25 SUSPENDED | group="main" sCount=1 dsCount=0 obj=0x42b044e0 self=0x62c6ae78 | sysTid=30950 nice=0 sched=0/0 cgrp=apps handle=1615996768 | state=S schedstat=( 8791873112 4710523269 7727 ) utm=851 stm=28 core=1 #00 pc 00021a98 /system/lib/libc.so (__futex_syscall3+8) #01 pc 0000f034 /system/lib/libc.so (__pthread_cond_timedwait_relative+48) #02 pc 0000f094 /system/lib/libc.so (__pthread_cond_timedwait+64) #03 pc 0005655f /system/lib/libdvm.so #04 pc 00056b21 /system/lib/libdvm.so (dvmChangeStatus(Thread*, ThreadStatus)+34) #05 pc 0004c3b3 /system/lib/libdvm.so #06 pc 0004e073 /system/lib/libdvm.so #07 pc 00083623 /system/lib/libandroid_runtime.so #08 pc 0008365b /system/lib/libandroid_runtime.so #09 pc 0002034c /system/lib/libdvm.so (dvmPlatformInvoke+112) #10 pc 00050fcf /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398) #11 pc 00000214 /dev/ashmem/dalvik-jit-code-cache (deleted) at android.media.AudioRecord.native_read_in_short_array(Native Method) at android.media.AudioRecord.read(AudioRecord.java:663) at com.tuner168.ble_bracelet_sim.audio.RecognizeThread.run(RecognizeThread.java:102) "Timer-2" prio=5 tid=20 TIMED_WAIT | group="main" sCount=1 dsCount=0 obj=0x42b1baf8 self=0x6057c798 | sysTid=30909 nice=0 sched=0/0 cgrp=apps handle=1621135960 | state=S schedstat=( 20484377 5202030 40 ) utm=2 stm=0 core=0 at java.lang.Object.wait(Native Method) - waiting on <0x42b1baf8> (a java.util.Timer$TimerImpl) at java.lang.Object.wait(Object.java:401) at java.util.Timer$TimerImpl.run(Timer.java:238) "pool-3-thread-2" prio=5 tid=24 TIMED_WAIT | group="main" sCount=1 dsCount=0 obj=0x4292c330 self=0x6057d638 | sysTid=30867 nice=0 sched=0/0 cgrp=apps handle=1658670960 | state=S schedstat=( 32660106 13747029 65 ) utm=3 stm=0 core=1 at java.lang.Object.wait(Native Method) - waiting on <0x4292c450> (a java.lang.VMThread) held by tid=24 (pool-3-thread-2) at java.lang.Thread.parkFor(Thread.java:1205) at sun.misc.Unsafe.park(Unsafe.java:325) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197) at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:429) at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:331) at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:910) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841) "Thread-1612" prio=5 tid=23 MONITOR | group="main" sCount=1 dsCount=0 obj=0x42927908 self=0x62dd56c0 | sysTid=30866 nice=0 sched=0/0 cgrp=apps handle=1656995496 | state=S schedstat=( 3839698317 1806337748 7682 ) utm=350 stm=33 core=1 at android.os.MessageQueue.enqueueMessage(MessageQueue.java:~318) - waiting to lock <0x4244ee90> (a android.os.MessageQueue) held by tid=30 (Thread-1623) at android.os.Handler.enqueueMessage(Handler.java:626) at android.os.Handler.sendMessageAtTime(Handler.java:595) at android.os.Handler.sendMessageDelayed(Handler.java:566) at android.os.Handler.sendEmptyMessageDelayed(Handler.java:530) at android.os.Handler.sendEmptyMessage(Handler.java:515) at com.zftpay.paybox.widget.customsialog.LoadingDialogView$UpdataThread.run(LoadingDialogView.java:112) at java.lang.Thread.run(Thread.java:841) "RefQueueWorker@org.apache.http.impl.conn.tsccm.ConnPoolByRoute@428b4460" daemon prio=5 tid=19 WAIT | group="main" sCount=1 dsCount=0 obj=0x428b72f8 self=0x62c0a5d8 | sysTid=30852 nice=0 sched=0/0 cgrp=apps handle=1616152720 | state=S schedstat=( 305990 46979 6 ) utm=0 stm=0 core=2 at java.lang.Object.wait(Native Method) - waiting on <0x428b6338> (a java.lang.ref.ReferenceQueue) at java.lang.Object.wait(Object.java:401) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73) at org.apache.http.impl.conn.tsccm.RefQueueWorker.run(RefQueueWorker.java:102) at java.lang.Thread.run(Thread.java:841) "CommunicationWithDeviceThread" prio=5 tid=21 NATIVE | group="main" sCount=1 dsCount=0 obj=0x427db388 self=0x60517ec0 | sysTid=28580 nice=0 sched=0/0 cgrp=apps handle=1615950296 | state=S schedstat=( 281667 0 2 ) utm=0 stm=0 core=0 #00 pc 000218d0 /system/lib/libc.so (epoll_wait+12) #01 pc 0001081b /system/lib/libutils.so (android::Looper::pollInner(int)+98) #02 pc 00010a45 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92) #03 pc 0006bb19 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22) #04 pc 0002034c /system/lib/libdvm.so (dvmPlatformInvoke+112) #05 pc 00050fcf /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398) #06 pc 000297e0 /system/lib/libdvm.so #07 pc 00030c6c /system/lib/libdvm.so (dvmMterpStd(Thread*)+76) #08 pc 0002e304 /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184) #09 pc 00063431 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336) #10 pc 00063455 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20) #11 pc 00058133 /system/lib/libdvm.so #12 pc 0000d240 /system/lib/libc.so (__thread_entry+72) #13 pc 0000d3d8 /system/lib/libc.so (pthread_create+240) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:138) at android.os.Looper.loop(Looper.java:123) at android.os.HandlerThread.run(HandlerThread.java:61) "Binder_4" prio=5 tid=18 NATIVE | group="main" sCount=1 dsCount=0 obj=0x4266e1c8 self=0x60525cf0 | sysTid=28564 nice=0 sched=0/0 cgrp=apps handle=1616009896 | state=S schedstat=( 17960418 45819164 121 ) utm=1 stm=0 core=3 #00 pc 0002071c /system/lib/libc.so (__ioctl+8) #01 pc 0002cf83 /system/lib/libc.so (ioctl+14) #02 pc 0001d471 /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+140) #03 pc 0001db7b /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+6) #04 pc 0001dc11 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+48) #05 pc 00021a89 /system/lib/libbinder.so #06 pc 0000eabd /system/lib/libutils.so (android::Thread::_threadLoop(void*)+216) #07 pc 0004e485 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+68) #08 pc 0000e5ef /system/lib/libutils.so #09 pc 0000d240 /system/lib/libc.so (__thread_entry+72) #10 pc 0000d3d8 /system/lib/libc.so (pthread_create+240) at dalvik.system.NativeStart.run(Native Method) "WifiManager" prio=5 tid=17 NATIVE | group="main" sCount=1 dsCount=0 obj=0x42573cd8 self=0x60524008 | sysTid=28561 nice=0 sched=0/0 cgrp=apps handle=1616004192 | state=S schedstat=( 17615048 65286354 145 ) utm=0 stm=1 core=0 #00 pc 000218d0 /system/lib/libc.so (epoll_wait+12) #01 pc 0001081b /system/lib/libutils.so (android::Looper::pollInner(int)+98) #02 pc 00010a45 /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92) #03 pc 0006bb19 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, int)+22) #04 pc 0002034c /system/lib/libdvm.so (dvmPlatformInvoke+112) #05 pc 00050fcf /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398) #06 pc 00000214 /dev/ashmem/dalvik-jit-code-cache (deleted) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:138) at android.os.Looper.loop(Looper.java:123) at android.os.HandlerThread.run(HandlerThread.java:61) "Binder_3" prio=5 tid=16 NATIVE | group="main" sCount=1 dsCount=0 obj=0x425317f8 self=0x60514010 | sysTid=28559 nice=0 sched=0/0 cgrp=apps handle=1615936968 | state=S schedstat=( 17389168 46019273 138 ) utm=0 stm=1 core=3 #00 pc 0002071c /system/lib/libc.so (__ioctl+8) #01 pc 0002cf83 /system/lib/libc.so (ioctl+14) #02 pc 0001d471 /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+140) #03 pc 0001db7b /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+6) #04 pc 0001dc11 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+48) #05 pc 00021a89 /system/lib/libbinder.so #06 pc 0000eabd /system/lib/libutils.so (android::Thread::_threadLoop(void*)+216) #07 pc 0004e485 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+68) #08 pc 0000e5ef /system/lib/libutils.so #09 pc 0000d240 /system/lib/libc.so (__thread_entry+72) #10 pc 0000d3d8 /system/lib/libc.so (pthread_create+240) at dalvik.system.NativeStart.run(Native Method) "java.lang.ProcessManager" daemon prio=5 tid=15 WAIT | group="main" sCount=1 dsCount=0 obj=0x4252fd28 self=0x60513768 | sysTid=28557 nice=0 sched=0/0 cgrp=apps handle=1615934240 | state=S schedstat=( 5171247 879583 37 ) utm=0 stm=0 core=1 at java.lang.Object.wait(Native Method) - waiting on <0x4252fb50> (a java.util.HashMap) at java.lang.Object.wait(Object.java:364) at java.lang.ProcessManager.waitForMoreChildren(ProcessManager.java:140) at java.lang.ProcessManager.watchChildren(ProcessManager.java:105) at java.lang.ProcessManager.access$000(ProcessManager.java:40) at java.lang.ProcessManager$1.run(ProcessManager.java:58) "FileObserver" prio=5 tid=14 SUSPENDED | group="main" sCount=1 dsCount=0 obj=0x424c8d30 self=0x5f551718 | sysTid=28554 nice=0 sched=0/0 cgrp=apps handle=1616506096 | state=S schedstat=( 2674007 4621617 16 ) utm=0 stm=0 core=0 at java.lang.StackTraceElement.<init>(StackTraceElement.java:~61) at dalvik.system.VMStack.getThreadStackTrace(Native Method) at java.lang.Thread.getStackTrace(Thread.java:579) at java.lang.Thread.getAllStackTraces(Thread.java:521) at com.tencent.bugly.proguard.a.a(BUGLY:943) at com.tencent.bugly.crashreport.crash.anr.b.a(BUGLY:395) at com.tencent.bugly.crashreport.crash.anr.b$1.onEvent(BUGLY:462) at android.os.FileObserver$ObserverThread.onEvent(FileObserver.java:125) at android.os.FileObserver$ObserverThread.observe(Native Method) at android.os.FileObserver$ObserverThread.run(FileObserver.java:88) "BUGLY_THREAD" prio=5 tid=12 TIMED_WAIT | group="main" sCount=1 dsCount=0 obj=0x42491a18 self=0x60297378 | sysTid=28553 nice=0 sched=0/0 cgrp=apps handle=1599414472 | state=S schedstat=( 13214376 14080415 57 ) utm=1 stm=0 core=0 at java.lang.Object.wait(Native Method) - waiting on <0x42491b38> (a java.lang.VMThread) held by tid=12 (BUGLY_THREAD) at java.lang.Thread.parkFor(Thread.java:1205) at sun.misc.Unsafe.park(Unsafe.java:325) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2056) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1062) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:778) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841) "BUGLY_THREAD" prio=5 tid=13 WAIT | group="main" sCount=1 dsCount=0 obj=0x4248fea8 self=0x6028f940 | sysTid=28552 nice=0 sched=0/0 cgrp=apps handle=1613299096 | state=S schedstat=( 109396885 61975669 283 ) utm=3 stm=7 core=2 at java.lang.Object.wait(Native Method) - waiting on <0x4248ffc8> (a java.lang.VMThread) held by tid=13 (BUGLY_THREAD) at java.lang.Thread.parkFor(Thread.java:1205) at sun.misc.Unsafe.park(Unsafe.java:325) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2017) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1057) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:778) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841) "BUGLY_THREAD" prio=5 tid=11 WAIT | group="main" sCount=1 dsCount=0 obj=0x4247f7d8 self=0x5f550d68 | sysTid=28550 nice=0 sched=0/0 cgrp=apps handle=1599410624 | state=S schedstat=( 25886336 22998661 313 ) utm=1 stm=1 core=0 at java.lang.Object.wait(Native Method) - waiting on <0x4247f9c8> (a java.lang.VMThread) held by tid=11 (BUGLY_THREAD) at java.lang.Thread.parkFor(Thread.java:1205) at sun.misc.Unsafe.park(Unsafe.java:325) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:157) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2017) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1057) at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:778) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1035) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1097) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841) "Binder_2" prio=5 tid=10 NATIVE | group="main" sCount=1 dsCount=0 obj=0x4244dec0 self=0x5f4d4008 | sysTid=28545 nice=0 sched=0/0 cgrp=apps handle=1596783464 | state=S schedstat=( 19653653 26620362 131 ) utm=1 stm=0 core=3 #00 pc 0002071c /system/lib/libc.so (__ioctl+8) #01 pc 0002cf83 /system/lib/libc.so (ioctl+14) #02 pc 0001d471 /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+140) #03 pc 0001db7b /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+6) #04 pc 0001dc11 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+48) #05 pc 00021a89 /system/lib/libbinder.so #06 pc 0000eabd /system/lib/libutils.so (android::Thread::_threadLoop(void*)+216) #07 pc 0004e485 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+68) #08 pc 0000e5ef /system/lib/libutils.so #09 pc 0000d240 /system/lib/libc.so (__thread_entry+72) #10 pc 0000d3d8 /system/lib/libc.so (pthread_create+240) at dalvik.system.NativeStart.run(Native Method) "Binder_1" prio=5 tid=9 NATIVE | group="main" sCount=1 dsCount=0 obj=0x4244dd20 self=0x5f2cf250 | sysTid=28544 nice=0 sched=0/0 cgrp=apps handle=1596780552 | state=S schedstat=( 17057920 52076197 126 ) utm=1 stm=0 core=3 #00 pc 0002071c /system/lib/libc.so (__ioctl+8) #01 pc 0002cf83 /system/lib/libc.so (ioctl+14) #02 pc 0001d471 /system/lib/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+140) #03 pc 0001db7b /system/lib/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+6) #04 pc 0001dc11 /system/lib/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+48) #05 pc 00021a89 /system/lib/libbinder.so #06 pc 0000eabd /system/lib/libutils.so (android::Thread::_threadLoop(void*)+216) #07 pc 0004e485 /system/lib/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+68) #08 pc 0000e5ef /system/lib/libutils.so #09 pc 0000d240 /system/lib/libc.so (__thread_entry+72) #10 pc 0000d3d8 /system/lib/libc.so (pthread_create+240) at dalvik.system.NativeStart.run(Native Method) "FinalizerWatchdogDaemon" daemon prio=5 tid=8 WAIT | group="system" sCount=1 dsCount=0 obj=0x424487f0 self=0x5bde28b0 | sysTid=28541 nice=0 sched=0/0 cgrp=apps handle=1541287176 | state=S schedstat=( 451876 609218 14 ) utm=0 stm=0 core=0 at java.lang.Object.wait(Native Method) - waiting on <0x417de668> (a java.lang.Daemons$FinalizerWatchdogDaemon) at java.lang.Object.wait(Object.java:364) at java.lang.Daemons$FinalizerWatchdogDaemon.waitForObject(Daemons.java:230) at java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:207) at java.lang.Thread.run(Thread.java:841) "FinalizerDaemon" daemon prio=5 tid=7 WAIT | group="system" sCount=1 dsCount=0 obj=0x42448640 self=0x5bde2008 | sysTid=28540 nice=0 sched=0/0 cgrp=apps handle=1541284960 | state=S schedstat=( 14235421 8436818 47 ) utm=1 stm=0 core=0 at java.lang.Object.wait(Native Method) - waiting on <0x417c97d8> (a java.lang.ref.ReferenceQueue) at java.lang.Object.wait(Object.java:401) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73) at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:170) at java.lang.Thread.run(Thread.java:841) "ReferenceQueueDaemon" daemon prio=5 tid=6 WAIT | group="system" sCount=1 dsCount=0 obj=0x424484d8 self=0x5ec14460 | sysTid=28539 nice=0 sched=0/0 cgrp=apps handle=1589725368 | state=S schedstat=( 2807867 4756510 18 ) utm=0 stm=0 core=0 at java.lang.Object.wait(Native Method) - waiting on <0x417c9700> at java.lang.Object.wait(Object.java:364) at java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:130) at java.lang.Thread.run(Thread.java:841) "Compiler" daemon prio=5 tid=5 VMWAIT | group="system" sCount=1 dsCount=0 obj=0x424483e8 self=0x5ec14008 | sysTid=28538 nice=0 sched=0/0 cgrp=apps handle=1541294864 | state=S schedstat=( 374628429 196207032 2486 ) utm=19 stm=18 core=0 #00 pc 00021a98 /system/lib/libc.so (__futex_syscall3+8) #01 pc 0000f034 /system/lib/libc.so (__pthread_cond_timedwait_relative+48) #02 pc 0000f094 /system/lib/libc.so (__pthread_cond_timedwait+64) #03 pc 00076c4b /system/lib/libdvm.so #04 pc 00057815 /system/lib/libdvm.so #05 pc 0000d240 /system/lib/libc.so (__thread_entry+72) #06 pc 0000d3d8 /system/lib/libc.so (pthread_create+240) at dalvik.system.NativeStart.run(Native Method) "JDWP" daemon prio=5 tid=4 VMWAIT | group="system" sCount=1 dsCount=0 obj=0x42448300 self=0x58b35830 | sysTid=28537 nice=0 sched=0/0 cgrp=apps handle=1487448632 | state=S schedstat=( 2560678 3524426 20 ) utm=0 stm=0 core=0 #00 pc 0002086c /system/lib/libc.so (select+20) #01 pc 0006433f /system/lib/libdvm.so #02 pc 00066e91 /system/lib/libdvm.so #03 pc 00057815 /system/lib/libdvm.so #04 pc 0000d240 /system/lib/libc.so (__thread_entry+72) #05 pc 0000d3d8 /system/lib/libc.so (pthread_create+240) at dalvik.system.NativeStart.run(Native Method) "Signal Catcher" daemon prio=5 tid=3 RUNNABLE | group="system" sCount=0 dsCount=0 obj=0x42448208 self=0x5bdde338 | sysTid=28536 nice=0 sched=0/0 cgrp=apps handle=1589714456 | state=R schedstat=( 21778283 13446303 35 ) utm=1 stm=1 core=1 at dalvik.system.NativeStart.run(Native Method) "GC" daemon prio=5 tid=2 VMWAIT | group="system" sCount=1 dsCount=0 obj=0x42448128 self=0x58b37830 | sysTid=28535 nice=0 sched=0/0 cgrp=apps handle=1541266408 | state=S schedstat=( 290835661 1780590841 14137 ) utm=2 stm=27 core=0 #00 pc 00021a98 /system/lib/libc.so (__futex_syscall3+8) #01 pc 0000f034 /system/lib/libc.so (__pthread_cond_timedwait_relative+48) #02 pc 0000f094 /system/lib/libc.so (__pthread_cond_timedwait+64) #03 pc 0007560f /system/lib/libdvm.so #04 pc 00057815 /system/lib/libdvm.so #05 pc 0000d240 /system/lib/libc.so (__thread_entry+72) #06 pc 0000d3d8 /system/lib/libc.so (pthread_create+240) at dalvik.system.NativeStart.run(Native Method) NATIVE THREADS: "gdingpai.paybox" sysTid=30946 nice=0 sched=0/0 cgrp=apps | state=S schedstat=( 9895416 257812 7 ) utm=0 stm=0 core=0 "gdingpai.paybox" sysTid=30947 nice=0 sched=0/0 cgrp=apps | state=S schedstat=( 49167 106614 2 ) utm=0 stm=0 core=0 "gdingpai.paybox" sysTid=30948 nice=0 sched=0/0 cgrp=apps | state=S schedstat=( 60885 0 2 ) utm=0 stm=0 core=0 "gdingpai.paybox" sysTid=30949 nice=0 sched=0/0 cgrp=apps | state=S schedstat=( 43230 9980989 3 ) utm=0 stm=0 core=0 "GL updater" sysTid=31132 nice=-10 sched=0/0 cgrp=apps | state=S schedstat=( 364636 305104 4 ) utm=0 stm=0 core=1 ----- end 28531 -----
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
【JSON解析】浅谈JSONObject的使用
简介 在程序开发过程中,在参数传递,函数返回值等方面,越来越多的使用JSON。JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,同时也易于机器解析和生成、易于理解、阅读和撰写,而且Json采用完全独立于语言的文本格式,这使得Json成为理想的数据交换语言。 JSON建构于两种结构: “名称/值”对的集合(A Collection of name/va...
《MySQL 性能优化》之理解 MySQL 体系结构
本文介绍 MySQL 的体系结构,包括物理结构、逻辑结构以及插件式存储引擎。
程序员请照顾好自己,周末病魔差点一套带走我。
程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。
卸载 x 雷某度!GitHub 标星 1.5w+,从此我只用这款全能高速下载工具!
作者 | Rocky0429 来源 | Python空间 大家好,我是 Rocky0429,一个喜欢在网上收集各种资源的蒟蒻… 网上资源眼花缭乱,下载的方式也同样千奇百怪,比如 BT 下载,磁力链接,网盘资源等等等等,下个资源可真不容易,不一样的方式要用不同的下载软件,因此某比较有名的 x 雷和某度网盘成了我经常使用的工具。 作为一个没有钱的穷鬼,某度网盘几十 kb 的下载速度让我...
只因接了一个电话,程序员被骗 30 万!
今天想给大家说一个刚刚发生在我身边的一起真实的诈骗经历,我的朋友因此被骗走30万。注:为了保护当事人隐私,部分情节进行了修改。1平安夜突来的电话开始以为就像普通的诈骗一样,想办法让你把钱...
我一个37岁的程序员朋友
周末了,人一旦没有点事情干,心里就瞎想,而且跟几个老男人坐在一起,更容易瞎想,我自己现在也是 30 岁了,也是无时无刻在担心自己的职业生涯,担心丢掉工作没有收入,担心身体机能下降,担心突...
python自动下载图片
近日闲来无事,总有一种无形的力量萦绕在朕身边,让朕精神涣散,昏昏欲睡。 可是,像朕这么有职业操守的社畜怎么能在上班期间睡瞌睡呢,我不禁陷入了沉思。。。。 突然旁边的IOS同事问:‘嘿,兄弟,我发现一个网站的图片很有意思啊,能不能帮我保存下来提升我的开发灵感?’ 作为一个坚强的社畜怎么能说自己不行呢,当时朕就不假思索的答应:‘oh, It’s simple. Wait for me for a ...
一名大专同学的四个问题
【前言】   收到一封来信,赶上各种事情拖了几日,利用今天要放下工作的时机,做个回复。   2020年到了,就以这一封信,作为开年标志吧。 【正文】   您好,我是一名现在有很多困惑的大二学生。有一些问题想要向您请教。   先说一下我的基本情况,高考失利,不想复读,来到广州一所大专读计算机应用技术专业。学校是偏艺术类的,计算机专业没有实验室更不用说工作室了。而且学校的学风也不好。但我很想在计算机领...
复习一周,京东+百度一面,不小心都拿了Offer
京东和百度一面都问了啥,面试官百般刁难,可惜我全会。
Java 14 都快来了,为什么还有这么多人固守Java 8?
从Java 9开始,Java版本的发布就让人眼花缭乱了。每隔6个月,都会冒出一个新版本出来,Java 10 , Java 11, Java 12, Java 13, 到2020年3月份,...
达摩院十大科技趋势发布:2020 非同小可!
【CSDN编者按】1月2日,阿里巴巴发布《达摩院2020十大科技趋势》,十大科技趋势分别是:人工智能从感知智能向认知智能演进;计算存储一体化突破AI算力瓶颈;工业互联网的超融合;机器间大规模协作成为可能;模块化降低芯片设计门槛;规模化生产级区块链应用将走入大众;量子计算进入攻坚期;新材料推动半导体器件革新;保护数据隐私的AI技术将加速落地;云成为IT技术创新的中心 。 新的画卷,正在徐徐展开。...
轻松搭建基于 SpringBoot + Vue 的 Web 商城应用
首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute): 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。Fun: Fun 是一个用于支持 Serverless 应用部署的工具,能帮助您便捷地管理函数计算、API ...
Python+OpenCV实时图像处理
目录 1、导入库文件 2、设计GUI 3、调用摄像头 4、实时图像处理 4.1、阈值二值化 4.2、边缘检测 4.3、轮廓检测 4.4、高斯滤波 4.5、色彩转换 4.6、调节对比度 5、退出系统 初学OpenCV图像处理的小伙伴肯定对什么高斯函数、滤波处理、阈值二值化等特性非常头疼,这里给各位分享一个小项目,可通过摄像头实时动态查看各类图像处理的特点,也可对各位调参、测试...
2020年一线城市程序员工资大调查
人才需求 一线城市共发布岗位38115个,招聘120827人。 其中 beijing 22805 guangzhou 25081 shanghai 39614 shenzhen 33327 工资分布 2020年中国一线城市程序员的平均工资为16285元,工资中位数为14583元,其中95%的人的工资位于5000到20000元之间。 和往年数据比较: yea...
为什么猝死的都是程序员,基本上不见产品经理猝死呢?
相信大家时不时听到程序员猝死的消息,但是基本上听不到产品经理猝死的消息,这是为什么呢? 我们先百度搜一下:程序员猝死,出现将近700多万条搜索结果: 搜索一下:产品经理猝死,只有400万条的搜索结果,从搜索结果数量上来看,程序员猝死的搜索结果就比产品经理猝死的搜索结果高了一倍,而且从下图可以看到,首页里面的五条搜索结果,其实只有两条才是符合条件。 所以程序员猝死的概率真的比产品经理大,并不是错...
害怕面试被问HashMap?这一篇就搞定了!
声明:本文以jdk1.8为主! 搞定HashMap 作为一个Java从业者,面试的时候肯定会被问到过HashMap,因为对于HashMap来说,可以说是Java集合中的精髓了,如果你觉得自己对它掌握的还不够好,我想今天这篇文章会非常适合你,至少,看了今天这篇文章,以后不怕面试被问HashMap了 其实在我学习HashMap的过程中,我个人觉得HashMap还是挺复杂的,如果真的想把它搞得明明白...
毕业5年,我问遍了身边的大佬,总结了他们的学习方法
我问了身边10个大佬,总结了他们的学习方法,原来成功都是有迹可循的。
推荐10个堪称神器的学习网站
每天都会收到很多读者的私信,问我:“二哥,有什么推荐的学习网站吗?最近很浮躁,手头的一些网站都看烦了,想看看二哥这里有什么新鲜货。” 今天一早做了个恶梦,梦到被老板辞退了。虽然说在我们公司,只有我辞退老板的份,没有老板辞退我这一说,但是还是被吓得 4 点多都起来了。(主要是因为我掌握着公司所有的核心源码,哈哈哈) 既然 4 点多起来,就得好好利用起来。于是我就挑选了 10 个堪称神器的学习网站,推...
这些软件太强了,Windows必装!尤其程序员!
Windows可谓是大多数人的生产力工具,集娱乐办公于一体,虽然在程序员这个群体中都说苹果是信仰,但是大部分不都是从Windows过来的,而且现在依然有很多的程序员用Windows。 所以,今天我就把我私藏的Windows必装的软件分享给大家,如果有一个你没有用过甚至没有听过,那你就赚了????,这可都是提升你幸福感的高效率生产力工具哦! 走起!???? NO、1 ScreenToGif 屏幕,摄像头和白板...
阿里面试,面试官没想到一个ArrayList,我都能跟他扯半小时
我是真的没想到,面试官会这样问我ArrayList。
曾经优秀的人,怎么就突然不优秀了。
职场上有很多辛酸事,很多合伙人出局的故事,很多技术骨干被裁员的故事。说来模板都类似,曾经是名校毕业,曾经是优秀员工,曾经被领导表扬,曾经业绩突出,然而突然有一天,因为种种原因,被裁员了,...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
良心推荐,我珍藏的一些Chrome插件
上次搬家的时候,发了一个朋友圈,附带的照片中不小心暴露了自己的 Chrome 浏览器插件之多,于是就有小伙伴评论说分享一下我觉得还不错的浏览器插件。 我下面就把我日常工作和学习中经常用到的一些 Chrome 浏览器插件分享给大家,随便一个都能提高你的“生活品质”和工作效率。 Markdown Here Markdown Here 可以让你更愉快的写邮件,由于支持 Markdown 直接转电子邮...
看完这篇HTTP,跟面试官扯皮就没问题了
我是一名程序员,我的主要编程语言是 Java,我更是一名 Web 开发人员,所以我必须要了解 HTTP,所以本篇文章就来带你从 HTTP 入门到进阶,看完让你有一种恍然大悟、醍醐灌顶的感觉。 最初在有网络之前,我们的电脑都是单机的,单机系统是孤立的,我还记得 05 年前那会儿家里有个电脑,想打电脑游戏还得两个人在一个电脑上玩儿,及其不方便。我就想为什么家里人不让上网,我的同学 xxx 家里有网,每...
史上最全的IDEA快捷键总结
现在Idea成了主流开发工具,这篇博客对其使用的快捷键做了总结,希望对大家的开发工作有所帮助。
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
谁是华为扫地僧?
是的,华为也有扫地僧!2020年2月11-12日,“养在深闺人不知”的华为2012实验室扫地僧们,将在华为开发者大会2020(Cloud)上,和大家见面。到时,你可以和扫地僧们,吃一个洋...
Idea 中最常用的10款插件(提高开发效率),一定要学会使用!
学习使用一些插件,可以提高开发效率。对于我们开发人员很有帮助。这篇博客介绍了开发中使用的插件。
AI 没让人类失业,搞 AI 的人先失业了
最近和几个 AI 领域的大佬闲聊 根据他们讲的消息和段子 改编出下面这个故事 如有雷同 都是巧合 1. 老王创业失败,被限制高消费 “这里写我跑路的消息实在太夸张了。” 王葱葱哼笑一下,把消息分享给群里。 阿杰也看了消息,笑了笑。在座几位也都笑了。 王葱葱是个有名的人物,21岁那年以全额奖学金进入 KMU 攻读人工智能博士,累计发表论文 40 余篇,个人技术博客更是成为深度学习领域内风向标。 ...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
作为一名大学生,如何在B站上快乐的学习?
B站是个宝,谁用谁知道???? 作为一名大学生,你必须掌握的一项能力就是自学能力,很多看起来很牛X的人,你可以了解下,人家私底下一定是花大量的时间自学的,你可能会说,我也想学习啊,可是嘞,该学习啥嘞,不怕告诉你,互联网时代,最不缺的就是学习资源,最宝贵的是啥? 你可能会说是时间,不,不是时间,而是你的注意力,懂了吧! 那么,你说学习资源多,我咋不知道,那今天我就告诉你一个你必须知道的学习的地方,人称...
木兰编程语言,当事人最新回复来了
同行12年,不知Python是木兰,当事人回应来了
那些年,我们信了课本里的那些鬼话
教材永远都是有错误的,从小学到大学,我们不断的学习了很多错误知识。 斑羚飞渡 在我们学习的很多小学课文里,有很多是错误文章,或者说是假课文。像《斑羚飞渡》: 随着镰刀头羊的那声吼叫,整个斑羚群迅速分成两拨,老年斑羚为一拨,年轻斑羚为一拨。 就在这时,我看见,从那拨老斑羚里走出一只公斑羚来。公斑羚朝那拨年轻斑羚示意性地咩了一声,一只半大的斑羚应声走了出来。一老一少走到伤心崖,后退了几步,突...
一个程序在计算机中是如何运行的?超级干货!!!
强烈声明:本文很干,请自备茶水!???? 开门见山,咱不说废话! 你有没有想过,你写的程序,是如何在计算机中运行的吗?比如我们搞Java的,肯定写过这段代码 public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } ...
那个在阿里养猪的工程师,5年了……
简介: 在阿里,走过1825天,没有趴下,依旧斗志满满,被称为“五年陈”。他们会被授予一枚戒指,过程就叫做“授戒仪式”。今天,咱们听听阿里的那些“五年陈”们的故事。 下一个五年,猪圈见! 我就是那个在养猪场里敲代码的工程师,一年多前我和20位工程师去了四川的猪场,出发前总架构师慷慨激昂的说:同学们,中国的养猪产业将因为我们而改变。但到了猪场,发现根本不是那么回事:要个WIFI,没有;...
为什么程序猿都不愿意去外包?
分享外包的组织架构,盈利模式,亲身经历,以及根据一些外包朋友的反馈,写了这篇文章 ,希望对正在找工作的老铁有所帮助
Java校招入职华为,半年后我跑路了
何来 我,一个双非本科弟弟,有幸在 19 届的秋招中得到前东家华为(以下简称 hw)的赏识,当时秋招签订就业协议,说是入了某 java bg,之后一系列组织架构调整原因等等让人无法理解的神操作,最终毕业前夕,被通知调往其他 bg 做嵌入式开发(纯 C 语言)。 由于已至于校招末尾,之前拿到的其他 offer 又无法再收回,一时感到无力回天,只得默默接受。 毕业后,直接入职开始了嵌入式苦旅,由于从未...
世界上有哪些代码量很少,但很牛逼很经典的算法或项目案例?
点击上方蓝字设为星标下面开始今天的学习~今天分享四个代码量很少,但很牛逼很经典的算法或项目案例。1、no code 项目地址:https://github.com/kelseyhight...
​两年前不知如何编写代码的我,现在是一名人工智能工程师
全文共3526字,预计学习时长11分钟 图源:Unsplash 经常有小伙伴私信给小芯,我没有编程基础,不会写代码,如何进入AI行业呢?还能赶上AI浪潮吗? 任何时候努力都不算晚。 下面,小芯就给大家讲一个朋友的真实故事,希望能给那些处于迷茫与徘徊中的小伙伴们一丝启发。(下文以第一人称叙述) 图源:Unsplash 正如Elsa所说,职业转换是...
强烈推荐10本程序员必读的书
很遗憾,这个春节注定是刻骨铭心的,新型冠状病毒让每个人的神经都是紧绷的。那些处在武汉的白衣天使们,尤其值得我们的尊敬。而我们这些窝在家里的程序员,能不外出就不外出,就是对社会做出的最大的贡献。 有些读者私下问我,窝了几天,有点颓丧,能否推荐几本书在家里看看。我花了一天的时间,挑选了 10 本我最喜欢的书,你可以挑选感兴趣的来读一读。读书不仅可以平复恐惧的压力,还可以对未来充满希望,毕竟苦难终将会...
非典逼出了淘宝和京东,新冠病毒能够逼出什么?
loonggg读完需要5分钟速读仅需 2 分钟大家好,我是你们的校长。我知道大家在家里都憋坏了,大家可能相对于封闭在家里“坐月子”,更希望能够早日上班。今天我带着大家换个思路来聊一个问题...
牛逼!一行代码居然能解决这么多曾经困扰我半天的算法题
春节假期这么长,干啥最好?当然是折腾一些算法题了,下面给大家讲几道一行代码就能解决的算法题,当然,我相信这些算法题你都做过,不过就算做过,也是可以看一看滴,毕竟,你当初大概率不是一行代码解决的。 学会了一行代码解决,以后遇到面试官问起的话,就可以装逼了。 一、2 的幂次方 问题描述:判断一个整数 n 是否为 2 的幂次方 对于这道题,常规操作是不断这把这个数除以 2,然后判断是否有余数,直到 ...
Spring框架|JdbcTemplate介绍
文章目录一、JdbcTemplate 概述二、创建对象的源码分析三、JdbcTemplate操作数据库 一、JdbcTemplate 概述 在之前的web学习中,学习了手动封装JDBCtemplate,其好处是通过(sql语句+参数)模板化了编程。而真正的JDBCtemplete类,是Spring框架为我们写好的。 它是 Spring 框架中提供的一个对象,是对原始 Jdbc API 对象的简单...
谁说程序员不懂浪漫——我的C语言结婚请柬(附源码)
前言:但行好事,莫问前程——《增广贤文》 从上学起开始学C++,后面也做过H5,现在做Android。无论是学习用的,还是工作用的,上百个软件不止。但最另我骄傲的是,我用程序烂漫了一把。 用C++语言,利用WIN32框架写一个结婚请柬,文末附源码和使用方法,大家可以自行修改,记得帮我点赞哦。 点开程序,你的电脑像中毒一般,漫天的樱花从屏幕上方,伴随着歌声《今天你要嫁给我》,缓缓落下。 ...
为什么说程序员做外包没前途?
之前做过不到3个月的外包,2020的第一天就被释放了,2019年还剩1天,我从外包公司离职了。我就谈谈我个人的看法吧。首先我们定义一下什么是有前途 稳定的工作环境 不错的收入 能够在项目中不断提升自己的技能(ps:非技术上的认知也算) 找下家的时候能找到一份工资更高的工作 如果你目前还年轻,但高不成低不就,只有外包offer,那请往下看。 外包公司你应该...
立即提问