Skip to content

Instantly share code, notes, and snippets.

View CodingFabian's full-sized avatar

Fabian Lange CodingFabian

View GitHub Profile
{
"openapi": "3.0.1",
"info": {
"contact": {
"email": "support@instana.com",
"name": "© Instana",
"url": "http://instana.com"
},
"termsOfService": "https://www.instana.com/terms-of-use/",
"title": "Introduction to Instana public APIs",
package com.fasterxml.jackson.benchmark;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Threads;
at sun.misc.Unsafe.putByte(Native Method)
at io.netty.util.internal.PlatformDependent0.putByte(PlatformDependent0.java:518)
at io.netty.util.internal.PlatformDependent.putByte(PlatformDependent.java:536)
at io.netty.buffer.UnsafeByteBufUtil.setByte(UnsafeByteBufUtil.java:133)
at io.netty.buffer.UnpooledUnsafeDirectByteBuf._setByte(UnpooledUnsafeDirectByteBuf.java:302)
at io.netty.buffer.AbstractByteBuf.writeByte(AbstractByteBuf.java:960
@CodingFabian
CodingFabian / gist:29ac2006442ff31efab47638d6a31184
Created October 11, 2017 20:57
Repeatable native memory crash of jvm
*** Error in `java': double free or corruption (out): 0x00007f61dc21dc70 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7c503)[0x7f621109e503]
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.30.amzn1.x86_64/jre/lib/amd64/server/libjvm.so(+0x606659)[0x7f6210718659]
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.30.amzn1.x86_64/jre/lib/amd64/server/libjvm.so(+0x6093ea)[0x7f621071b3ea]
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.30.amzn1.x86_64/jre/lib/amd64/server/libjvm.so(+0x443557)[0x7f6210555557]
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.30.amzn1.x86_64/jre/lib/amd64/server/libjvm.so(+0x443928)[0x7f6210555928]
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.30.amzn1.x86_64/jre/lib/amd64/server/libjvm.so(+0x989ee3)[0x7f6210a9bee3]
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.30.amzn1.x86_64/jre/lib/amd64/server/libjvm.so(+0x8e0391)[0x7f62109f2391]
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.30.amzn1.x86_64/jre/lib/amd64/server/libjvm.so(+0x8e17b7)[0x7f62109f37b7]
public class A implements IF {
public void foo(Object arg) {
}
}
-XX:+UseSerialGC
-XX:InitialCodeCacheSize=4m -XX:ReservedCodeCacheSize=16m
-XX:-TieredCompilation -XX:CompressedClassSpaceSize=16m
-XX:MinMetaspaceExpansion=1M -XX:MaxMetaspaceExpansion=8M -XX:MaxMetaspaceSize=64m
-XX:MaxDirectMemorySize=16m
-noverify -Xmn16m -Xss265k -Xms40m -Xmx40m
@CodingFabian
CodingFabian / jep.md
Created August 5, 2016 12:11
Command Line Flag for suggested Processor Count

// // JDK Enhancement Proposal ("JEP") body template, v2.0 // // ==> Delete all lines starting with "//" // before entering a proposal into JBS // // Instances of this template are meant to be evolving documents. When // you initially draft a JEP you don't need to fill out every section of // the template, and in fact at that point you probably won't be able to // do so. As you get feedback and build consensus around your proposal

HTTP2Client client = new HTTP2Client();
SslContextFactory sslContextFactory = new SslContextFactory(true);
HTTP2ClientConnectionFactory h2 = new HTTP2ClientConnectionFactory();
client.setClientConnectionFactory(h2);
client.addBean(h2);
client.addBean(sslContextFactory);
client.start();
FuturePromise<Session> sessionPromise = new FuturePromise<>();
client.connect(sslContextFactory, new InetSocketAddress(host, port), new ServerSessionListener.Adapter(), sessionPromise);
#!/bin/bash
export JAVA_HOME=/opt/jdk1.8.0_60
KARAF_HOME=/opt/apache-karaf
$KARAF_HOME/bin/status > /dev/null
case $1 in
start)
if [ "$?" -eq "1" ]; then
@CodingFabian
CodingFabian / FileAccess.java
Last active April 12, 2018 04:38
Nio vs Io File Absence performance
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
// uses counter to ensure we get a cache miss from whatever might be caching
@State(Scope.Thread)
public class FileAccess {