Skip to content

Instantly share code, notes, and snippets.

View gvsmirnov's full-sized avatar

Gleb Smirnov gvsmirnov

  • Bayesian Conspiracy (probably)
  • The Multiverse
View GitHub Profile
[7168160.156548] bash invoked oom-killer: gfp_mask=0x26000c0, order=2, oom_score_adj=0
[7168160.156551] bash cpuset=/ mems_allowed=0
[7168160.156556] CPU: 0 PID: 23277 Comm: bash Not tainted 4.4.0-59-generic #80-Ubuntu
[7168160.156558] Hardware name: Xen HVM domU, BIOS 4.2.amazon 09/19/2016
[7168160.156559] 0000000000000286 0000000021d7e43c ffff8800207dbaf0 ffffffff813f7583
[7168160.156562] ffff8800207dbcc8 ffff880033b60e00 ffff8800207dbb60 ffffffff8120ad5e
[7168160.156564] ffffffff81cd2dc7 0000000000000000 ffffffff81e67760 0000000000000206
[7168160.156567] Call Trace:
[7168160.156573] [<ffffffff813f7583>] dump_stack+0x63/0x90
[7168160.156577] [<ffffffff8120ad5e>] dump_header+0x5a/0x1c5
@gvsmirnov
gvsmirnov / keybase.md
Created February 13, 2017 09:59
keybase.md

Keybase proof

I hereby claim:

  • I am gvsmirnov on github.
  • I am gvsmirnov (https://keybase.io/gvsmirnov) on keybase.
  • I have a public key whose fingerprint is 1F68 AD1C 4DB0 C74F AFD3 6F57 B755 94A9 D00B 6279

To claim this, I am signing this object:

@gvsmirnov
gvsmirnov / Oom.java
Last active January 6, 2017 17:31
Garbage Collection Considered Harmful
import java.util.*;
public class Oom {
public static void main(String[] args) {
List<Object> sink = new ArrayList<>();
while(true) {
sink.add(new Object());
}
}
@gvsmirnov
gvsmirnov / fix.diff
Created January 31, 2016 17:45
Boxing Fixed
7c7
< private static volatile Double sensorValue;
---
> private static volatile double sensorValue = Double.NaN;
15,16c15,16
< private static void processSensorValue(Double value) {
< if(value != null) {
---
> private static void processSensorValue(double value) {
> if(!Double.isNaN(value)) {
Process: idea [13368]
Path: /Applications/IntelliJ IDEA 15.app/Contents/MacOS/idea
Identifier: com.jetbrains.intellij
Version: 15.0.2 (IU-143.1184.17)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: idea [13368]
User ID: 501
Date/Time: 2016-01-18 10:55:49.837 +0200
Process: idea [1324]
Path: /Applications/IntelliJ IDEA 15.app/Contents/MacOS/idea
Identifier: com.jetbrains.intellij
Version: 15.0.2 (IU-143.1184.17)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: idea [1324]
User ID: 501
Date/Time: 2016-01-14 13:09:47.341 +0200
Process: idea [69393]
Path: /Applications/IntelliJ IDEA 15.app/Contents/MacOS/idea
Identifier: com.jetbrains.intellij
Version: 15.0.2 (IU-143.1184.17)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: idea [69393]
User ID: 501
Date/Time: 2016-01-13 23:05:45.587 +0200
/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java -XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xmx2g -Didea.launcher.port=7534 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 15.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Content
@gvsmirnov
gvsmirnov / EscapingThisFromConstructorTest.java
Last active August 29, 2015 14:19
Escaping this from constructor
package org.openjdk.jcstress.tests.finals;
import org.openjdk.jcstress.annotations.*;
import org.openjdk.jcstress.infra.results.IntResult2;
import org.openjdk.jcstress.infra.results.IntResult4;
@JCStressTest
@State
@Outcome(id = "[0, 0, 0, 0]", expect = Expect.ACCEPTABLE, desc = "Neither of the escaped writes is observed")
@Outcome(id = "[1, 42, 1, 42]", expect = Expect.ACCEPTABLE, desc = "Both of the escaped writes are observed, and the write to the final field is observed in both cases")

Correspondence between Sun/Oracle JDK, OpenJDK and HotSpot VM versions

build date Sun/Oracle JDK Version OpenJDK Version HotSpot VM Version
2006-11-29 1.6.0-b105 1.6.0-b105
2007-03-14 1.6.0_01-b06 1.6.0_01-b06
2007-06-22 1.6.0_02-b05 1.6.0_02-b05
2007-09-24 1.6.0_03-b05 1.6.0_03-b05
2007-12-14 1.6.0_04-b12 10.0-b19