In Memory Data Grids Best Practices
Talip Ozturk (Founder Hazelcast)
Talip spent some time discussing the key features of IMDG which he considered important with no surprises;
- Native Objects
- High Performance
- High Scale
Common features of Data Grids are;
- Distributed Maps
- Code Execution
- JPA L2 cache
- Backing Cache Store - write behind, write through and read through
Most of the talk was a summary of C2B2's data grid workshop with no real insights.
Innovative Testing Techniques with Byte Code instrumentation
Talk about using ASM to do Byte Code injection when doing testing. BCI can replace method bodies or replace whole classes without changing the underlying code. Limitations of BCI are;
- Fields can't be added or removed
- Methods can't be added or removed
- Method signatures can't be changed
- java.lang classes can't be modified
Testing exception handling
Many exceptions are difficult to set up in a test environment. However Byecode injection can force exceptions to occur in your tests.The technique is to manipulate the class that throws the exception using BCI to force the throw. Using a Java agent on the command line of the JVM the agent manipulates the bytecodes of the classes as they are loaded.
Testing memory exhaustion
Similarly you can byte code inject a class to throw an OOME at a point in time or under certain conditions in the system under test.
Testing secure paths through the code
Test difficult to reach codepaths in large scale applications.
Tools are available to help with generating asm code. ASMifier is an Eclipse plugin which can turn a method in your class and show it as the ASM code you would need to implement the Java code.
Diagnosing your applications on the JVM
Staffan Larsen Oracle
The session was about tools available to diagnose application problems that come with the JDK. In retrospect I shouldn't have attended this talk as use of these tools is bread and butter for C2B2. However future tools and new insights were;
jcmd came in JDK 7 which I have blogged about previously,
jcmd 0 will send the same command to all Java processes running e.g.
jcmd 0 uptime
jcmd also has a help by running
jcmd 0 help <command>
jcmd 0 VM.flags all
however not many of the jrockit commands have been ported over yet.
jcmd 0 thread print also has deadlock detection and will print out deadlocked threads it also works with java.util.concurrent locks
jcmd 0 PerfCounters.print prints all the raw performance counters in the JVM
jcmd 0 GC.heap_dump <filename>
JVisualVM can compare two heapdumps to detect histogram changes in object counts which can be useful in working out what classes are leaking.
Java Flight Recorder is coming but only as a license option in Java SE advanced.
Java Mission Control is also coming to JavaSE
jcmd will have more commands and this will replace all the other j* tools
JMX 2.0 is having more life breathed into it
improved logging which I've mentioned in the first day blogs
Java Discovery Protocol a way to broadcast on the network what JVMs are available