iowait

iowait iowait 表示在一个采样周期内有百分之几的时间属于以下情况: CPU空闲、并且有仍未完成的 I/O 请求。 对 %iowait 常见的误解有两个: 一是误以为 %iowait 表示 CPU不能工

Guava cache

Guava cache http://www.cnblogs.com/peida/p/Guava_Cache.html 缓存,在我们日常开发中是必不可少的一种解决性能问题的方法。简单的说,cache 就是为了提升系统性能而开辟的一块内存空间。 缓存的主要作用

vmstat

vmstat 1 2 3 4 5 6 7 vmstat -SM 1 vmstat 1 10 # vmstat每2秒采集数据,一直采集,直到结束程序 vmstat 2 # 2表示每两秒采集一次服务器状态,1表示只采集一次。 vmstat 2

jvm thread DestroyJavaVM

jvm thread DestroyJavaVM DestroyJavaVM is a thread that unloads the Java VM on program exit. Most of the time it should be waiting, until apocalypse of your VM. Signal Dispatcher is a thread that handles the native signals sent by the OS to your jvm. Finalizer threads pull objects from the finalization queue and calls it finalize method. Reference Handler is a high-priority thread to enqueue pending References. Its defined in java.

Java 获取 进程PID

Java 获取 进程PID 1 2 3 4 5 6 7 8 9 String name = ManagementFactory.getRuntimeMXBean().getName(); // get pid String pid = name.split("@")[0]; logger.info("PID:{}", pid); 之前并不知道Java中如何能够获取当前进程 (也就是包含当前Java程序的JVM所

JVM编译器

JVM编译器 即时编译器 Java虚拟机中内置了两个即时编译器,分别为Client和Server或则叫C1和C2. C1编译器将字节码编译为本地代

Java Scanner

Java Scanner http://blog.csdn.net/carolzhang8406/article/details/6726589 一、扫描控制台输入 这个例子是常常会用到,但是如果没有Scanner,你写写就知道多难受了。 当通过new Scanner(System.i

pthread

pthread code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> void* xc(void* arg){ char* c=(char*)arg; printf("参数%s \n",c); int i=0; for (;i<10;i++){ printf(

多线程的代价及上下文切换

多线程的代价及上下文切换 http://www.cnblogs.com/shangxiaofei/p/5762895.html 关于时间, 创建线程使用是直接向系统申请资源的, 这里调用系统函数进行分配资源的话耗时不好说。 关于资源, Java线程的

公平锁, 非公平锁

公平锁, 非公平锁 公平锁: 每个线程抢占锁的顺序为先后调用lock方法的顺序依次获取锁,类似于排队吃饭。 非公平锁: 每个线程抢占锁的顺序不定,谁运

重排序 Reorder

重排序 Reorder 编译器和处理器可能会对操作做重排序。编译器和处理器在重排序时,会遵守数据依赖性,编译器和处理器不会改变存在数据依赖关系的两个操作的执

Java ReentrantLock, synchronized

Java ReentrantLock, synchronized http://www.ibm.com/developerworks/cn/java/j-jtp10264/index.html 多线程和并发性并不是什么新内容,但是 Java 语言设计中的创新之一就是,它是第一个直接把跨平台线程模型和正规的内存模型集成到语言中的主流语言

cp command

cp command 1 2 3 # 把 dir0 下面的文件和子目录复制到 dir1 # -R, -r, --recursive copy directories recursively cp -r /path/to/dir0/* /path/to/dir1

java 8 新特性

java 8 新特性 https://www.ibm.com/developerworks/cn/java/j-lo-jdk8newfeature/ http://www.ruanyifeng.com/blog/2012/04/functional_programming.html http://www.jianshu.com/p/5b800057f2d8

java 7, jdk 7

java 7, jdk 7 数字文字中的下划线 Java 7的一个特性是数字文字中的下划线。可以在任何数字文字的数字之间放置下划线,如:int,byte,short,fl

协程, coroutine, goroutine

协程, coroutine, goroutine routine, [ruːˈtiːn], 例程 coroutine, [kəruːˈtiːn], 协同程序, 协程 Goroutine 是 Go 中最基本的执行单元。每一个 Go 程序至少有一个 gorout

wait(),notify(),notifyAll()

wait(),notify(),notifyAll() notifyAll 是一个重的方法,它会带来大量的上下文切换和锁竞争。 wait(),notify(),notifyAll()不属于Thread类,而是属于O

java juc锁 Lock

java juc锁 Lock 与synchronized不同的是,Lock完全用Java写成,在java这个层面是无关JVM实现的。 在java.util.co