build date | Sun/Oracle JDK Version | OpenJDK Version | HotSpot VM Version |
---|---|---|---|
2006-11-29 | 1.6.0-b105 | 1.6.0-b105 | |
2007-03-14 | 1.6.0_01-b06 | 1.6.0_01-b06 | |
2007-06-22 | 1.6.0_02-b05 | 1.6.0_02-b05 | |
2007-09-24 | 1.6.0_03-b05 | 1.6.0_03-b05 | |
2007-12-14 | 1.6.0_04-b12 | 10.0-b19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
import sun.jvm.hotspot.memory.*; | |
import sun.jvm.hotspot.oops.*; | |
import sun.jvm.hotspot.debugger.*; | |
import sun.jvm.hotspot.runtime.*; | |
import sun.jvm.hotspot.tools.*; | |
import sun.jvm.hotspot.utilities.*; | |
public class DirectMemorySize extends Tool { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 b java.lang.String::charAt (33 bytes) | |
2 b java.lang.Math::max (11 bytes) | |
3 b java.util.jar.Manifest$FastInputStream::readLine (167 bytes) | |
4 b sun.nio.cs.UTF_8$Decoder::decodeArrayLoop (553 bytes) | |
5 b java.util.Properties$LineReader::readLine (383 bytes) | |
6 b java.lang.String::hashCode (60 bytes) | |
7 b java.lang.String::indexOf (151 bytes) | |
8 b sun.nio.cs.ext.DoubleByteDecoder::decodeSingle (10 bytes) | |
9 b java.lang.String::lastIndexOf (156 bytes) | |
10 b java.lang.String::replace (142 bytes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ export SAPATH=/home/sajia/taobao-jdk-repo/hotspot/make/linux/linux_amd64_compiler2/generated/ | |
$ java -classpath .:$SAPATH/sa-jdi.jar sun.jvm.hotspot.tools.JMap -histo `pgrep java` > jmap_output.log | |
Attaching to process ID 1587, please wait... | |
WARNING: Hotspot VM version 20.5-b03 does not match with SA version 20.0-b12-internal. You may see unexpected results. | |
Debugger attached successfully. | |
Server compiler detected. | |
JVM version is 20.5-b03 | |
Iterating over heap. This may take a while... | |
Heap traversal took 3.577 seconds. | |
$ java -version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getPropertiesFrom(obj) { | |
obj.metaClass.properties.findAll { it.name != 'class' && it.name != 'metaClass' }.inject([:]) { acc, e -> acc[e.name] = e.getProperty(obj); acc } | |
} | |
class Foo { | |
int getBar() { 42; } | |
List getProperties() { [] } | |
} | |
def foo = new Foo(); | |
foo.properties; //=> [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.apache.commons.lang.StringEscapeUtils.escapeJava; | |
import static org.apache.commons.lang.StringUtils.isEmpty; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.apache.velocity.runtime.parser.node.ASTAddNode; | |
import org.apache.velocity.runtime.parser.node.ASTAndNode; | |
import org.apache.velocity.runtime.parser.node.ASTAssignment; | |
import org.apache.velocity.runtime.parser.node.ASTBlock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
import sun.jvm.hotspot.memory.*; | |
import sun.jvm.hotspot.oops.*; | |
import sun.jvm.hotspot.debugger.*; | |
import sun.jvm.hotspot.runtime.*; | |
import sun.jvm.hotspot.tools.*; | |
public class DumpClassURL extends Tool { | |
public void run() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
// #include <jit/jit-dump.h> | |
#include <jit/jit-plus.h> | |
// Create an example function equivalent to: | |
// int foo(int x, int y, int z) { | |
// return x + y * z; | |
// } | |
jit_function create_example_foo(jit_context& context, int opt_level) { | |
jit_type_t signature = jit_function::signature_helper( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MysteryBox { | |
private long x0, x1; | |
private boolean y0, y1, y2, y3; | |
private int z0; | |
private double[] a = new double[8]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ javap -verbose -c -s -l -private Demo\$\$Lambda\$1 | |
Classfile /private/tmp/Demo$$Lambda$1.class | |
Last modified Oct 12, 2016; size 754 bytes | |
MD5 checksum 81ce9dafbca34417b2dfa94f596a85a1 | |
final class Demo$$Lambda$1 implements org.apache.spark.api.java.function.VoidFunction | |
minor version: 0 | |
major version: 52 | |
flags: ACC_FINAL, ACC_SUPER, ACC_SYNTHETIC | |
Constant pool: | |
#1 = Utf8 Demo$$Lambda$1 |
NewerOlder