Skip to content

Instantly share code, notes, and snippets.

@aragozin
aragozin / gist:6ac622de6328a1b6ee58a1bf6f2e523d
Last active September 12, 2022 18:55
Workshop JVM diagnostics tools
git clone -b hz_demo_step_1 https://github.com/aragozin/proflab.git hz_bench
git clone -b bench/deadlock/master https://github.com/aragozin/proflab.git deadlock
git clone -b demo https://github.com/aragozin/spring-petclinic.git petclinic
cd hz_bench
mvn -P bench test
jcmd 4252 ManagementAgent.start jmxremote.authenticate=false jmxremote.ssl=false jmxremote.port=5555 jmxremote.rmi.port=5555
@aragozin
aragozin / setup.txt
Last active September 12, 2022 18:55
JMC Workshop Notes
clone https://github.com/aragozin/optaplanner-bench.git
git checkout jmc_workbench_0
mvn package
mvn -P ui exec:java
Disable some JVM optimizations
MAVEN_OPTS=-Xmx512m -XX:+NeverActAsServerClassMachine -XX:CICompilerCount=1 -XX:-TieredCompilation -XX:-DoEscapeAnalysis
mvn -P mrbench exec:java
@aragozin
aragozin / cardTableRS.cpp
Created July 6, 2011 10:48
OpenJDK GC patch, modified code
void ClearNoncleanCardWrapper::do_MemRegion(MemRegion mr) {
assert(mr.word_size() > 0, "Error");
assert(_ct->is_aligned(mr.start()), "mr.start() should be card aligned");
// mr.end() may not necessarily be card aligned.
jbyte* cur_entry = _ct->byte_for(mr.last());
const jbyte* limit = _ct->byte_for(mr.start());
HeapWord* end_of_non_clean = mr.end();
HeapWord* start_of_non_clean = end_of_non_clean;
while (cur_entry >= limit) {
HeapWord* cur_hw = _ct->addr_for(cur_entry);
@aragozin
aragozin / cardTableRS.cpp
Created July 6, 2011 10:46
OpenJDK GC patch, original code
void ClearNoncleanCardWrapper::do_MemRegion(MemRegion mr) {
assert(mr.word_size() > 0, "Error");
assert(_ct->is_aligned(mr.start()), "mr.start() should be card aligned");
// mr.end() may not necessarily be card aligned.
jbyte* cur_entry = _ct->byte_for(mr.last());
const jbyte* limit = _ct->byte_for(mr.start());
HeapWord* end_of_non_clean = mr.end();
HeapWord* start_of_non_clean = end_of_non_clean;
while (cur_entry >= limit) {
HeapWord* cur_hw = _ct->addr_for(cur_entry);