Skip to content

Instantly share code, notes, and snippets.

@kirkch
kirkch / gist:5211438
Last active December 15, 2015 05:49
Useful JVM Settings (Oracle VM)
Native Compilation Options
-----------------------
XX:+PrintCompilation Prints out when HotSpot stops the world to compile a method into native code
-XX:CompileThreshold=1000 Sets the number of invocations required before a method will be considered for compilation.
Trades off startup time and resources for speed. -client sets this to 1500, -server runs with 10,000
@kirkch
kirkch / gzip all files
Created February 9, 2013 16:05
gzip multiple files individually
find . -maxdepth 1 -type f ! -name `*.gz` -exec gzip "{}" \;
@kirkch
kirkch / gist:3450993
Created August 24, 2012 14:07
Changing ulimit on Ubuntu
Verification
Check your system limits:
$ cat /proc/sys/fs/file-max
$ sysctl -a |grep fs.file-max
To check the number of file descriptors used by any given process use
$ ls -la /proc/<pid>/fd
@kirkch
kirkch / gist:3427722
Created August 22, 2012 17:23
rsync notes
-- RSync server config ( /etc/zeebox/rsync.conf
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
[cache]
path = /mnt/cache
uid = tomcat
gid = tomcat
@kirkch
kirkch / gist:3427668
Created August 22, 2012 17:15
Expanding jar files in a directory on to a Java Classpath
Use this when the Java 5 dir/* syntax does not work. This hit me using Gatling on Ubuntu recently.
CLASSPATH="$(echo $GATLING_HOME/lib/*.jar | tr ' ' ':'):$GATLING_CONF:${JAVA_CLASSPATH}"
@kirkch
kirkch / gist:3402882
Created August 20, 2012 10:19
Fast ways of writing to disk in Java
import java.io.*;
import java.nio.*;
import java.nio.channels.*;
/**
* Compares the performance of streaming data to disk vs using memory mapped files.
*.
public class MappedIO {
private static int numOfInts = 4000000;
@kirkch
kirkch / ProxifierPerformance.java
Created July 31, 2012 06:35 — forked from garcia-jj/ProxifierPerformance.java
cglib vs javassist performance tests
package com.mosaic.esa;
import javassist.util.proxy.MethodHandler;
import javassist.util.proxy.ProxyFactory;
import javassist.util.proxy.ProxyObject;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;
import org.junit.Test;