Skip to content

Instantly share code, notes, and snippets.

Yasumasa Suenaga YaSuenag

Block or report user

Report or block YaSuenag

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@YaSuenag
YaSuenag / Makefile
Last active Apr 20, 2017
Example code of HeapStats realtime deadlock detector
View Makefile
.PHONY: clean
CFLAGS = -fPIC -g
LDFLAGS = -lpthread
CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
TARGETS = libdltest.so libdltest-jmm.so
all: $(TARGETS)
libdltest.so: deadlockDetector.o
View JMXClient.java
import java.io.*;
import java.util.*;
import java.util.stream.*;
import java.lang.reflect.*;
import javax.management.*;
import sun.tools.jconsole.*;
public class JMXClient implements AutoCloseable{
@YaSuenag
YaSuenag / error1.log
Created Jun 26, 2016
Build JDK 9 with GCC 6.1.1
View error1.log
/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/altHashing.cpp:227:43: error: narrowing conversion of '2206368128u' from 'unsigned int' to 'jint {aka int}' inside { } [-Wnarrowing]
static const jint ONE_INT[] = { 0x83828180};
^
/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/altHashing.cpp:238:55: error: narrowing conversion of '2206368128u' from 'unsigned int' to 'jint {aka int}' inside { } [-Wnarrowing]
static const jint TWO_INT[] = { 0x83828180, 0x87868584};
^
/home/ysuenaga/OpenJDK/hs/hotspot/src/share/vm/classfile/altHashing.cpp:238:55: error: narrowing conversion of '2273740164u' from 'unsigned int' to 'jint {aka int}' inside { } [-Wnarrowing]
lib/CompileJvm.gmk:193: recipe for target '/home/ysuenaga/OpenJDK/hs/build/linux-x86_64-normal-server-fastdebug/hotspot/variant-server/libjvm/objs/altHashing.o' failed
gmake[4]: *** [/home/ysuenaga/OpenJDK/hs/build/linux-x86_64-normal-server-fastde
@YaSuenag
YaSuenag / gist:a4bea7922bd0790550d4
Last active May 19, 2017
JVMCIを使ってみよう(メソッドプロファイル取得編)
View gist:a4bea7922bd0790550d4

とりあえず、JVMCI経由でメソッドプロファイル情報を取得してみます。

方針

  • プロファイルを取得したいクラスを予め決めておき、シャットダウンフック実行時に一気にダンプします。
  • JVMCIではメソッド単位でコントロール可能ですが、とりあえずクラス内定義メソッド全部をダンプするようにします。

JVMCI取得部

/*
 * Copyright (C) 2015 Yasumasa Suenaga
@YaSuenag
YaSuenag / gist:382ab8855905600e735c
Last active May 12, 2017
Raspbian/Pidoraをvirt-managerから使ってみる
View gist:382ab8855905600e735c

環境

  • Fedora21
    • libvirt
    • virt-manager
    • qemu-system-arm
    • libguestfs-tools-c
  • Raspbian
  • Pidora20

下準備

You can’t perform that action at this time.