Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright 2018 Andrei Pangin
*
* This is a specialized Java port of the FlameGraph script available at
* https://github.com/brendangregg/FlameGraph/blob/master/flamegraph.pl
*
* Copyright 2016 Netflix, Inc.
* Copyright 2011 Joyent, Inc. All rights reserved.
* Copyright 2011 Brendan Gregg. All rights reserved.
*
@yaoliao
yaoliao / 1、SynHeaderTest.java
Last active April 18, 2020 15:04
java 对象头中 synchronized 的标记
package com.example.demo.jol;
import org.openjdk.jol.info.ClassLayout;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
/**
* @author: TuGai
* @createTime: 2020-04-15 19:48
@yaoliao
yaoliao / ObjectHeader32.txt
Created April 6, 2020 15:19 — forked from arturmkrtchyan/ObjectHeader32.txt
Java Object Header
|----------------------------------------------------------------------------------------|--------------------|
| Object Header (64 bits) | State |
|-------------------------------------------------------|--------------------------------|--------------------|
| Mark Word (32 bits) | Klass Word (32 bits) | |
|-------------------------------------------------------|--------------------------------|--------------------|
| identity_hashcode:25 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Normal |
|-------------------------------------------------------|--------------------------------|--------------------|
| thread:23 | epoch:2 | age:4 | biased_lock:1 | lock:2 | OOP to metadata object | Biased |
|-------------------------------------------------------|--------------------------------|--------------------|
|
@yaoliao
yaoliao / InstrumentationSupport.java
Last active April 6, 2020 14:55
获取 Instrumentation copy from jol
/*
* Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*