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
$ java -XX:+PrintFlagsFinal -Xmn200m -Xmn300m -Xmn400m | grep 'NewSize' | |
uintx MaxNewSize := 419430400 {product} | |
uintx NewSize := 419430400 {product} | |
uintx NewSizeThreadIncrease = 5320 {pd product} | |
$ java -XX:+PrintFlagsFinal -Xmn200m -Xmn300m -Xmn400m -XX:MaxNewSize=100m | grep 'NewSize' | |
uintx MaxNewSize := 419430400 {product} | |
uintx NewSize := 419430400 {product} | |
uintx NewSizeThreadIncrease = 5320 {pd product} | |
$ java -XX:+PrintFlagsFinal -Xmn200m -Xmn300m -Xmn400m -XX:MaxNewSize=100m -XX:NewSize=100m | grep 'NewSize' | |
uintx MaxNewSize := 104857600 {product} |
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
package nerdscentral; | |
public class LoopTest { | |
static long count = 0; | |
static class ReturnDispatch extends RuntimeException{ | |
@Override | |
public Throwable fillInStackTrace(){ |
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
package nerdscentral; | |
public class LoopTest { | |
static long count = 0; | |
static class ReturnDispatch extends RuntimeException{ | |
@Override | |
public Throwable fillInStackTrace(){ |
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
rednaxelafx@fx-laptop:~$ jps | |
2477 GroovyStarter | |
2576 Jps | |
rednaxelafx@fx-laptop:~$ pgrep java | |
2477 | |
rednaxelafx@fx-laptop:~$ echo $JAVA_HOME | |
/home/rednaxelafx/sdk/jdk1.6.0_25 | |
rednaxelafx@fx-laptop:~$ sudo su | |
root@fx-laptop:/home/rednaxelafx# pgrep java | |
2477 |
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 Test { | |
public static void main(String[] args) { | |
byte[] placeholder = new byte[64 * 1024 * 1024]; | |
System.gc(); | |
} | |
} |
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
$ groovysh | |
Groovy Shell (1.7.5, JVM: 1.7.0-ea) | |
Type 'help' or '\h' for help. | |
------------------------------------------------------------------------------- | |
groovy:000> import java.lang.invoke.* | |
===> [import java.lang.invoke.*] | |
groovy:000> mt = MethodType.methodType(String, String) | |
===> (String)String | |
groovy:000> MethodHandles.exactInvoker(mt) | |
===> MethodHandle(MethodHandle,String)String |
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
$ use6u25 | |
$ java -version | |
java version "1.6.0_25" | |
Java(TM) SE Runtime Environment (build 1.6.0_25-b06) | |
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode) | |
$ groovysh | |
Groovy Shell (1.7.5, JVM: 1.6.0_25) | |
Type 'help' or '\h' for help. | |
------------------------------------------------------------------------------- | |
groovy:000> s = new String([(byte) 'a', (byte) 'b'] as byte[]) |
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
D:\sdk\groovy-1.7.6\bin>set JAVA_OPTS=-XX:+UseConcMarkSweepGC | |
D:\sdk\groovy-1.7.6\bin>java -version | |
java version "1.6.0_26" | |
Java(TM) SE Runtime Environment (build 1.6.0_26-b03) | |
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing) | |
D:\sdk\groovy-1.7.6\bin>groovysh | |
Groovy Shell (1.7.6, JVM: 1.6.0_26) | |
Type 'help' or '\h' for help. |
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 JAVA_OPTS='-XX:+PrintGCDetails -XX:+UseConcMarkSweepGC' | |
$ groovysh | |
[GC [ParNew: 17024K->2112K(19136K), 0.0320220 secs] 17024K->2503K(83008K), 0.0323140 secs] [Times: user=0.04 sys=0.00, real=0.03 secs] | |
[GC [ParNew: 19136K->2112K(19136K), 0.1166830 secs] 19527K->6890K(83008K), 0.1167640 secs] [Times: user=0.26 sys=0.02, real=0.12 secs] | |
Groovy Shell (1.7.7, JVM: 1.6.0_25) | |
Type 'help' or '\h' for help. | |
----------------------------------------------------------------------------------------------------------------- | |
groovy:000> list = [] | |
===> [] | |
groovy:000> 1000000.times { list << [:] } |
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.util.*; | |
/* | |
*/ | |
public class WrongInline { | |
public static void test(String[] args) { | |
List<?> list; | |
if (args.length % 2 == 0) { | |
list = new ArrayList<String>(); // list1 | |
} else { |
OlderNewer