Skip to content

Instantly share code, notes, and snippets.

@zafarella
zafarella / jvm tuning
Last active December 20, 2015 19:09
jvm tuning
JAVA_OPTS="-Djava.awt.headless=true -Xmx7000M -Xms7000M -XX:MaxPermSize=768M -XX:PermSize=1024M -XX:MaxNewSize=1024M -XX:NewSize=768M -XX:SurvivorRatio=10 -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -verbose:gc -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -Xloggc:$LOG_TOMCAT_GC -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=50000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=$CATALINA_HOME/conf/jmxremote.passwd -Dcom.sun.management.jmxremote.access.file=$CATALINA_HOME/conf/jmxremote.access -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"
@zafarella
zafarella / TOMCAT JVM Tuning (NO JMX Tuning)
Created August 9, 2013 00:06
Tomcat jvm param with more aggressive GC and memory optimization. Use with caution on prod.
JAVA_OPTS="-Djava.awt.headless=true -Xmx7000M -Xms7000M -XX:MaxPermSize=768M -XX:PermSize=1024M -XX:MaxNewSize=1024M -XX:NewSize=768M -XX:SurvivorRatio=10 -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=80 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -verbose:gc -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled"
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@zafarella
zafarella / idea64.vmoptions
Created January 21, 2015 01:06
faster 64bit IntelliJ Idea JVM options
-ea
-server
-Xms2g
-Xmx4g
-Xss16m
-XX:PermSize=456m
-XX:MaxPermSize=556m
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
-XX:+UnlockExperimentalVMOptions
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
# smooth scrolling
defaults write -g NSScrollAnimationEnabled -bool false
# showing and hiding sheets, resizing preference windows, zooming windows
# float 0 doesn’t work
@zafarella
zafarella / apache felix
Created October 2, 2015 03:11
apache felix install eb console
g! deploy org.apache.felix.webconsole
# do lb
# and start
# start HTTP Service (1.0.0)
# and
# Apache Felix Web Management Console
g! start 10
g! start 10
@zafarella
zafarella / compress_jpg.sh
Last active October 15, 2015 03:01
compress JPG files in batch using imagick
#!/bin/bash
for f in *.JPG
do
mogrify -verbose -quality "97%" -resize 2048x2048 -filter Lanczos -interlace Plane ${f} _${f}
done
-ea
-server
-Xms2g
-Xmx4g
-Xss16m
-XX:+DoEscapeAnalysis
-XX:+UseCompressedOops
-XX:+UnlockExperimentalVMOptions
-XX:+UseConcMarkSweepGC
-XX:LargePageSizeInBytes=256m
@zafarella
zafarella / intellij VM Options
Created November 14, 2016 04:18
IntelliJ IDEA 2016.2.5 VM options for better response time. (OSX 16GB) -> Help -> Edit custom VM options
-Xms128m
-Xmx1g
-XX:ReservedCodeCacheSize=240m
-XX:+UseCompressedOops
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:ConcGCThreads=4
-XX:+AlwaysPreTouch
-XX:+TieredCompilation
-XX:+UseCompressedOops
@zafarella
zafarella / checkout-folder
Created June 26, 2018 17:20
git checkout only specific folder
#!/usr/bin/env bash
#
# Checkout only specific folder
#
cd /tmp
rm -rf test && mkdir test && cd test
git init
git remote add origin [email protected]:zafarella/OSX-RAMDisk.git