03 2016 档案
摘要:from http://blog.igorminar.com/2007/03/how-java-application-can-discover-its.html Occasionally it is important for an application to know its PID, spe
阅读全文
摘要:ObjectHeader32.txt |----------------------------------------------------------------------------------------|--------------------| | Object Header (64 bits) ...
阅读全文
摘要:几天前在HLLVM群组有人问了个小问题,说 Java代码 public class Test { static Test2 t1 = new Test2(); Test2 t2 = new Test2(); public void fn() { Test2 t3 = new Test2(); } }
阅读全文
摘要:from http://rednaxelafx.iteye.com/blog/730461 接着前天的与昨天的帖,今天也来介绍一个HotSpot的Serviceability Agent(以下简称SA)的玩法例子。 昨天用SA把x86机器码反汇编到汇编代码,或许对多数Java程序员来说并不怎么有趣。
阅读全文
摘要:from http://blog.csdn.net/on_1y/article/details/24290985 对C语言中的static关键字的深入理解 在阅读一些项目源代码时,我发现很多时候,会把函数和变量声明为static,所以,很好奇为什么要这样做,于是有了下面这篇文章。 基本概念 使用st
阅读全文
摘要:from http://www.oracle.com/technetwork/articles/javase/jvmti-136367.html The Java Virtual Machine Tool Interface (JVMTI) provides a programming interf
阅读全文
摘要:from http://blog.csdn.net/on_1y/article/details/24660859 在Java多线程程序中,由于线程调度,指令间的次序在每次运行时都可能不相同,有时候,我们需要得到指令次序,用来分析程序的行为。这样细粒度的底层行为用一般方法很难完成,我们需要借助 JVM
阅读全文
摘要:from https://opencredo.com/lambda-memoization-in-java-8/ Memoization is a technique whereby we trade memory for execution speed. Suppose you have a fu
阅读全文
摘要:from https://opencredo.com/new-tricks-with-dynamic-proxies-in-java-8-part-3/ In this post, the last in the New Tricks With Dynamic Proxies series (see
阅读全文
摘要:from https://opencredo.com/dynamic-proxies-java-part-2/ Consider an instance of java.reflection.InvocationHandler that simply passes every method call
阅读全文
摘要:from https://opencredo.com/dynamic-proxies-java/ Dynamic proxies have been a feature of Java since version 1.3. They were widely used in J2EE for remo
阅读全文
摘要:from http://arturmkrtchyan.com/java-object-header Have you ever wondered how java object looks like inside JVM ? Today’s post will mainly target the h
阅读全文
摘要:from http://arturmkrtchyan.com/jvm-biased-locking In today’s article I’m going to talk about Biased Locking in jvm. In case you are not familiar with
阅读全文
摘要:转自 http://www.cnblogs.com/redcreen/archive/2011/03/29/1998801.html Java偏向锁(Biased Locking)是Java6引入的一项多线程优化。它通过消除资源无竞争情况下的同步原语,进一步提高了程序的运行性能。
阅读全文
摘要:转自http://www.cnblogs.com/redcreen/archive/2011/03/29/1998801.html 大家知道,Java的多线程安全是基于Lock机制实现的,而Lock的性能往往不如人意。原因是,monitorenter与monitorexit这两个控制多线程同步的b
阅读全文
摘要:指令码 助记符 说明 0x00 nop 什么都不做 0x01 aconst_null 将null推送至栈顶 0x02 iconst_m1 将int型-1推送至栈顶 0x03 iconst_0 将int型0推送至栈顶 0x04
阅读全文
摘要:Stop the world pauses of JVM due to work of garbage collector are known foes of java based application. HotSpot JVM has a set of very advanced and tun
阅读全文
摘要:from http://coolshell.cn/articles/9606.html 在淘宝内网里看到同事发了贴说了一个CPU被100%的线上故障,并且这个事发生了很多次,原因是在Java语言在并发情况下使用HashMap造成Race Condition,从而导致死循环。这个事情我4、5年前也经历
阅读全文
摘要:Strongly reachable: An object that can be accessed by a strong reference. Softly reachable: An object that is not strongly reachable and can be access
阅读全文
摘要:from https://dzone.com/articles/letting-garbage-collector-do-c Garbage collection in Java is great, but in some cases you want to listen when an objec
阅读全文
摘要:from http://hongjiang.info/java-referencequeue/#comment-4236 看到了这篇帖子: 《WeakHashMap的神话》http://www.javaeye.com/topic/587995因为Javaeye回帖还要先做个论坛小测验,所以懒得在上面
阅读全文
摘要:from http://www.infoq.com/cn/articles/Java-Application-Hostile-to-JIT-Compilation 在JVM中,即时编译器(以下简称JIT)是很重要的一部分,可以帮助应用大幅度提升执行效率。但是很多程序却并不能很好地利用JIT的高性能优
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> #include <stddef.h> #include <string.h> #include "jvmti.h" #include "jni.h" #pragma GCC diagnostic ignored "-Ww
阅读全文
摘要:Question: How to make a dump before and after a full GC? JDk already support our requirement. What we need is just enable below red flag. We have two
阅读全文
摘要:import java.util.*; public class HashMapStackOverflow { public static void main(String[] args) throws Exception { HashMap<String, Object> map = new Ha
阅读全文