Friday, February 27, 2015

It's cool to be Oracle Certified Specialist

You can stick this diploma on your bedroom's wall and impress your friends...





After all it cost me only like 250 USD....



Thursday, February 26, 2015

RDF, OWL, SPARQL....


I post these interesting Wikipedia articles, it's always good to learn something new to impress girls in conversations on the train (hahaha just kidding) :

these readings are about the "web metadata"  story (the need to embed relational [a is father of b] statements in web documents, so that an agent can parse them and build a DB of facts).

http://en.wikipedia.org/wiki/Resource_Description_Framework

http://en.wikipedia.org/wiki/Semantic_Web

http://en.wikipedia.org/wiki/SPARQL

http://en.wikipedia.org/wiki/Web_Ontology_Language


For some "semantic repositories" DBs:
http://en.wikipedia.org/wiki/Sesame_%28framework%29

http://www.oracle.com/technetwork/database/options/spatialandgraph/overview/index.html on Oracle Spatial and Graph

http://www.systap.com/ Systap Bigdata

http://www.ontotext.com/products/ontotext-graphdb/  Ontotext GraphDB




Also interesting reading:

ever wondered about the difference between a Type 1 and a Type 2 Hypervisor? Here goes the story:

http://en.wikipedia.org/wiki/Hypervisor





Tuesday, February 10, 2015

Garbage Collection Resources

If you are confronted with a JVM crash in PROD, you might want first to read some documents on GC.

http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html for Java 6, very well explained conceptually.

http://www.fasterj.com/articles/oraclecollectors1.shtml brillant lookup of the main flags available, and possible combination of GC for yound and old generation (Java 7)

http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html list of all JDK 7 options.

To test the options, you can run InfiniteLoop.java :

public class InfiniteLoop {
    public static void main(String[] args) throws Exception {
        for (;;) {Thread.sleep(1000);}
    }
}


and run jconsole....in the "threads" tab you have a nice summary of the Eden Space, Survivor Space, Old Gen.

you can also run jinfo:
jinfo -flag UseParallelGC 3797
jinfo -flag MinHeapFreeRatio 3797
jinfo -flag UseSerialGC 3797



where 3797 is the process PID.

Attempts to change GC strategy runtime :

jinfo -flag +UseSerialGC 3797

will miserably fail:

Exception in thread "main" java.io.IOException: Command failed in target VM
 at sun.tools.attach.BsdVirtualMachine.execute(BsdVirtualMachine.java:208)
 at sun.tools.attach.HotSpotVirtualMachine.executeCommand(HotSpotVirtualMachine.java:217)
 at sun.tools.attach.HotSpotVirtualMachine.setFlag(HotSpotVirtualMachine.java:190)
 at sun.tools.jinfo.JInfo.flag(JInfo.java:129)
 at sun.tools.jinfo.JInfo.main(JInfo.java:76)



On a different topic, read also:

1 - http://www.oracle.com/technetwork/java/javase/crashes-137240.html this document about troubleshooting system crashes

2 - http://www.oracle.com/technetwork/java/hotspotfaq-138619.html this interesting FAQ list

3 - this document http://www.oracle.com/technetwork/java/jdk50-ts-guide-149808.pdf (a bit outdated) about jmap, jinfo, jstack etc

4 - http://www.oracle.com/technetwork/java/javase/index-137495.html this one repeats more or less - with more details - the info in the above document n. 3

Priceless are these commands:
jmap -heap 3843
jmap -histo 3843
jmap -permstat 3843
jmap -dump:file=dump.map 3843
jhat -port 7401 dump.map (at this point open your browser at localhost:7401)

jstat -gc 3843
jstat -printcompilation 3843

jstat -gcutil 3843 250 7