Skip to content

Instantly share code, notes, and snippets.

View rednaxelafx's full-sized avatar

Kris Mok rednaxelafx

View GitHub Profile
@rednaxelafx
rednaxelafx / command prompt
Created August 15, 2011 18:37
building Maxine VM on Mac OS X 10.7
Last login: Tue Aug 16 01:27:40 on ttys001
Kriss-MacBook-Air:~ rednaxelafx$ cd build/maxine/
Kriss-MacBook-Air:maxine rednaxelafx$ max
Maxine Launcher
available commands:
build compile the Maxine Java and C sources, linking the latter
c1x process a list of methods with the C1X compiler
check run Checkstyle on the Maxine Java sources
clean Remove all class files, images, and executables
@rednaxelafx
rednaxelafx / .hotspot_compiler
Created August 29, 2011 09:15
OptimizeStringConcat on HotSpot 22.0-b02
exclude * main
@rednaxelafx
rednaxelafx / modifications.diff
Created September 4, 2011 18:07
Modifications to the default Octopress blog for my blog on Github
Binary files ./source/images/avatar.jpg and /home/rednaxelafx/coderepo/gitrepo/octopress/source/images/avatar.jpg differ
diff -rupN ./source/_includes/custom/asides/about.html /home/rednaxelafx/coderepo/gitrepo/octopress/source/_includes/custom/asides/about.html
--- ./source/_includes/custom/asides/about.html 2011-09-05 01:49:29.787989004 +0800
+++ /home/rednaxelafx/coderepo/gitrepo/octopress/source/_includes/custom/asides/about.html 2011-09-04 21:50:03.177989008 +0800
@@ -1,4 +1,19 @@
<section>
<h1>About Me</h1>
- <p>A little something about me.</p>
+ <p>
+ <img src="/images/avatar.jpg" width="120" style="float:left;margin-right:10px" />
@rednaxelafx
rednaxelafx / command_prompt
Created September 12, 2011 17:38
My Acer Aspire 4741G's status after 10 months of use. Battery's capacity dropped quite a bit. Learned to use 'acpi' from http://www.linuxondesktop.in/2011/03/ubuntu-tips-manage-cpu-tempreature.html
rednaxelafx@fx-laptop:~$ acpi -v
The program 'acpi' is currently not installed. You can install it by typing:
sudo apt-get install acpi
rednaxelafx@fx-laptop:~$ sudo apt-get install acpi
[sudo] password for rednaxelafx:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
acpi
@rednaxelafx
rednaxelafx / hs_err_pid2820.log
Created September 14, 2011 13:18
An example showing that the default stack size of a Java process is 320KB on 32-bit Windows, Oracle JDK 6 update 26, as specified in the java.exe launcher's PE properties.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d98aa84, pid=2820, tid=2600
#
# JRE version: 6.0_26-b03
# Java VM: Java HotSpot(TM) Client VM (20.1-b02 mixed mode, sharing windows-x86 )
# Problematic frame:
# V [jvm.dll+0xeaa84]
#
@rednaxelafx
rednaxelafx / TestIntegerCache.java
Created September 20, 2011 06:49
In Oracle/Sun JDK, setting Java property "java.lang.Integer.IntegerCache.high" affects the size of the Integer cache, whether or not it came from -XX:AutoBoxCacheMax
public class TestIntegerCache {
public static void main(String[] args) {
puts("1: " + ((Object) 2000 == (Object) 2000));
puts("2: " + ((Object) 2001 == (Object) 2001));
}
public static void puts(String s) {
System.out.println(s);
}
}
@rednaxelafx
rednaxelafx / log
Created September 21, 2011 06:04
Just installed IBM JDK 7 for a ride
===============================================================================
Pre-Installation Summary
------------------------
Please Review the Following Before Continuing:
Product Name:
IBM 64-bit Linux SDK for Java v7
Install Folder:
@rednaxelafx
rednaxelafx / Test.java
Created October 13, 2011 11:51
Threads when running a 64-bit HotSpot VM with default args. ParallelScavenge's GCTaskThread's are alive from very early stage.
public class Test {
public static void main(String[] args) throws Exception {
System.in.read();
}
}
@rednaxelafx
rednaxelafx / gist:1284125
Created October 13, 2011 12:30
Large array created during "revptrs" processing, in CLHSDB (HS20)
hsdb> revptrs
Usage: revptrs address
hsdb> revptrs 0x620001670
Computing reverse pointers...
==WARNNING== allocate too large array--thread_id[0x000000005ef8a800]--thread_name[main]--array_size[71303184 bytes]--array_length[17825792 elememts]
prio=10 tid=0x000000005ef8a800 nid=0x1bda runnable at sun.jvm.hotspot.utilities.BitMap.<init>(BitMap.java:34)
at sun.jvm.hotspot.utilities.MarkBits.<init>(MarkBits.java:45)
at sun.jvm.hotspot.utilities.ReversePtrsAnalysis.run(ReversePtrsAnalysis.java:88)
at sun.jvm.hotspot.CommandProcessor$9.doit(CommandProcessor.java:518)
at sun.jvm.hotspot.CommandProcessor.executeCommand(CommandProcessor.java:1437)
@rednaxelafx
rednaxelafx / Test.java
Created October 13, 2011 14:19
Notes on how HotSpot keeps track of initiating class loaders (diff against HS20-b11)
import java.io.*;
import java.net.*;
public class Test {
public static void main(String[] args) throws Exception {
// use system class loader as parent
ClassLoader loader = new URLClassLoader(new URL[] { });
Class.forName("java.lang.String", true, loader);
loader.loadClass("Foo");
Class.forName("Bar", true, loader);