Skip to content

Instantly share code, notes, and snippets.

@ykubota
ykubota / execute.md
Last active October 27, 2015 17:10
Jigsaw jdeps/jlink demo's command
  • jdeps -M -s lib/*

  • jdeps -genmoduleinfo msrc lib/*

    • msrc//module-info.java
    • requires / exports / provides 修飾子
  • jdeps -R -cp lib/* lib/(what_you_want).jar

  • jdeps -s -R -cp lib/* lib/(what_you_want).jar

  • jdeps -s -ct -R -cp lib/* lib/(what_you_want).jar

  • jlink --help

  • jlink --modulepath $JMODS --addmods java.base --output yimage --exclude-files *.diz

@ykubota
ykubota / mysql.sh
Created June 18, 2013 07:12
Setup MySQL@Fedora18 for redmine
#sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel
sudo yum install -y mysql mysql-server
sudo vim /etc/my.cnf
---
# nihongo mojibake taisaku
character-set-server = utf8
---
@ykubota
ykubota / setup.sh
Created June 19, 2013 02:23
GlassFish for Redmine
sudo yum install jruby
gem install warbler
cd redmine
gem install activerecord-jdbc-adapter -v '1.2.5'
warble config
vim config/warble.rb
warble war
@ykubota
ykubota / new_gist_file
Created June 21, 2013 02:33
glassfish redmine
$ jruby -v
jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on OpenJDK 64-Bit Server VM 1.7.0_25-mockbuild_2013_06_19_07_21-b00 [linux-amd64]
org.jruby.exceptions.RaiseException: (LoadError) load error: openssl -- java.lang.NoClassDefFoundError: Could not initialize class org.jruby.ext.openssl.ASN1
|A')?
$ vim Gemfile
32 # jruby-openssl is bundled with JRuby 1.7.0
33 gem "jruby-openssl" if Object.const_defined?(:JRUBY_VERSION) && JRUBY_VERS ION < '1.7.0'
|A')<usotuki-
@ykubota
ykubota / ClassHistrogram.groovy
Created December 9, 2013 18:38
ClassHistrogram集計用クラス。 クラスヒストグラムを1回以上出力させたログを読み込ませると、[クラス名][クラスヒストグラムインデックス] = [ランク, インスタンス, バイト数] となる二次元配列を取得する。
def static calc(filename){
def sheet = [:];
def h=[:];
def time = 0;
def seek = false
// ファイル読み込み
new File(filename).eachLine {
// 正規表現
if (it ==~ /^num\s+#instances\s+#bytes\s+class\sname/){
// Start of ClassHistogram
@ykubota
ykubota / sample.gdb
Created July 26, 2016 07:33
check address of counter and its member
set logging on
set logging file /path/to/file
f 7
p/x counter
p/x counter->objData
p/x (TObjectData *)counter->objData
p/x counter->objData->klassOop
@ykubota
ykubota / GCLimit.java
Last active October 18, 2016 09:50
reproduce sample: java.lang.OutOfMemoryError: GC overhead limit exceeded
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class GCLimit {
static public void main(String[] args) {
Random random = new Random();
List<String> interned = new ArrayList<>();
while(true) {
int length = random.nextInt(100);
@ykubota
ykubota / core.2832 (bt)
Last active July 6, 2017 02:23
TBB crash log
(gdb) bt
#0 0x00007f523e4741d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007f523e4758c8 in __GI_abort () at abort.c:90
#2 0x00007f523dda7c89 in os::abort (dump_core=<optimized out>)
at /usr/src/debug/java-1.8.0-openjdk-1.8.0.131-3.b12.el7_3.x86_64/openjdk/hotspot/src/os/linux/vm/os_linux.cpp:1513
#3 0x00007f523df496d6 in VMError::report_and_die (this=this@entry=0x7f51f31f5150)
at /usr/src/debug/java-1.8.0-openjdk-1.8.0.131-3.b12.el7_3.x86_64/openjdk/hotspot/src/share/vm/utilities/vmError.cpp:1060
#4 0x00007f523ddb1347 in JVM_handle_linux_signal (sig=11, info=0x7f51f31f53f0, ucVoid=0x7f51f31f52c0,
abort_if_unrecognized=<optimized out>)
at /usr/src/debug/java-1.8.0-openjdk-1.8.0.131-3.b12.el7_3.x86_64/openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp:541
@ykubota
ykubota / gdb-2763.log
Created July 7, 2017 00:13
crash by a73e611
#0 0x00007f47efbb21d7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1 0x00007f47efbb38c8 in __GI_abort () at abort.c:90
#2 0x00007f47ef4e5c89 in os::abort (dump_core=<optimized out>)
at /usr/src/debug/java-1.8.0-openjdk-1.8.0.131-3.b12.el7_3.x86_64/openjdk/hotspot/src/os/linux/vm/os_linux.cpp:1513
#3 0x00007f47ef6876d6 in VMError::report_and_die (this=this@entry=0x7f47d6749da0)
at /usr/src/debug/java-1.8.0-openjdk-1.8.0.131-3.b12.el7_3.x86_64/openjdk/hotspot/src/share/vm/utilities/vmError.cpp:1060
#4 0x00007f47ef687d97 in crash_handler (sig=11, info=0x7f47d6749ff0, ucVoid=0x7f47d6749ec0)
at /usr/src/debug/java-1.8.0-openjdk-1.8.0.131-3.b12.el7_3.x86_64/openjdk/hotspot/src/os/linux/vm/vmError_linux.cpp:106
#5 <signal handler called>
#6 os::is_first_C_frame (fr=fr@entry=0x7f47d674aaa0)
@ykubota
ykubota / gcc version
Created July 24, 2017 06:09
__cplusplus on RHEL 7.
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)