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
# custom IntelliJ IDEA VM options | |
-server | |
-Xss16m | |
-Xms256m | |
-Xmx1500m | |
-XX:ReservedCodeCacheSize=240m | |
-XX:+AlwaysPreTouch | |
-XX:+TieredCompilation | |
-XX:+UseCompressedOops | |
-XX:+UseCompressedClassesPointers |
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
# Base settings and GC logging | |
-server -XX:+AlwaysPreTouch # First should be default, but we make it explicit, second pre-zeroes memory mapped pages on JVM startup -- improves runtime performance | |
# -Xloggc:gc-%t.log # CUSTOMIZE LOCATION HERE - $path/gc-%t.log -- the %t in the gc log file path is so we get a new file with each JVM restart | |
-XX:NumberOfGCLogFiles=5 -XX:+UseGCLogFileRotation -XX:GCLogFileSize=20m # Limits the number of files, logs to folder | |
-XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCCause | |
-XX:+PrintTenuringDistribution -XX:+PrintReferenceGC -XX:+PrintAdaptiveSizePolicy # gather info on object age & reference GC time for further tuning if needed. | |
# G1 specific settings -- probably should be default for multi-core systems with >2 GB of heap (below that, default is probably fine) | |
-XX:+UseG1GC | |
-XX:+UseStringDeduplication |
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
#!/bin/python | |
import sys | |
import re | |
# You'll need to extract JUST the table of pstools output (no headers!) from your pstools thread dumps for windows | |
print(sys.argv) | |
if not sys.argv[1] or not sys.argv[2]: | |
print("Need to supply the path to the pstools before and after filenames") | |
exit() |
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
// Test for handling of errors in nested blocks, and UI rendering of same | |
stage 'sample' | |
node { | |
dir('sample') { | |
dir('more') { | |
sh 'failme' | |
} | |
} | |
} |
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
#!/bin/bash | |
# Curl the bandwidth test site for 10 MB file and get speed in bytes/second, reboot cable modem if <5 MBit | |
# Useful as bash alias that retests and triggers every hour: | |
# alias continuously_speedtest='while [ true ]; do echo "Sleeping 1 hour and then speedtesting network"; sleep 3600; bash ~/speedtest-restart.sh; done' | |
set -o pipefail | |
echo 'Speedtesting modem now' | |
DOWN_SPEED=$(curl http://speedtest.wdc01.softlayer.com/downloads/test10.zip -t 100 -o /dev/null -s -w "%{speed_download}" | sed -E "s/\.[0-9]+//g") | |
if [ "$?" -ne 0 ]; then | |
echo "Speed test failed!" |
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
One source: http://developers.redhat.com/blog/2014/07/22/dude-wheres-my-paas-memory-tuning-javas-footprint-in-openshift-part-2/ | |
# Set the XMX to cap your max heap, set the xms to a reasonable minimum | |
-Xmx384m -Xms100m | |
# No more than 40% of heap free, lowest GC overhead and keeps heap small - still under 0.5% GC time | |
seropt: | |
-XX:+UseSerialGC -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 | |
# parallel version, allows up to 4% time spent on GC, generally uses heap more efficiently, but at cost of 2x the CPU USE |
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 hudson.cli; | |
import org.junit.Test; | |
import java.util.*; | |
// Micro benchmark different array ops in Java | |
// Originally started from http://stackoverflow.com/questions/322715/when-to-use-linkedlist-over-arraylist/7507740#7507740 | |
// Now completely rewritten to correctly warm up the JIT compilation and take an average over many runs | |
// Tweaked/corrected version from http://stackoverflow.com/questions/322715/when-to-use-linkedlist-over-arraylist/7507740#7507740 |