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
/** | |
* VM options: -verbose:gc -Xms:20M -Xms20M -Xmn10M -XX:+PrintGCDetails -XX:PretenureSizeThreshold=3145728 | |
*/ | |
public class MemoryAllocateOld { | |
private static final int _1mb = 1024 * 1024; | |
public static void main(String[] args) { | |
byte[] alloc1, alloc2, alloc3, alloc4; | |
alloc1 = new byte[_1mb / 4]; |
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
/** | |
* VM options: -verbose:gc -Xms:20M -Xms20M -Xmn10M -XX:+PrintGCDetails -XX:PretenureSizeThreshold=3145728 | |
*/ | |
public class MemoryAllocateBigObject { | |
private static final int _1mb = 1024 * 1024; | |
public static void main(String[] args) { | |
byte[] alloc1, alloc2, alloc3, alloc4; | |
alloc1 = new byte[4 * _1mb]; |
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
/** | |
* VM options: -verbose:gc -Xms:20M -Xms20M -Xmn10M -XX:+PrintGCDetails | |
*/ | |
public class MemoryAllocate { | |
private static final int _1mb = 1024 * 1024; | |
public static void main(String[] args) { | |
byte[] alloc1, alloc2, alloc3, alloc4; | |
alloc1 = new byte[2 * _1mb]; |
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
import net.sf.cglib.proxy.Enhancer; | |
import net.sf.cglib.proxy.MethodInterceptor; | |
import net.sf.cglib.proxy.MethodProxy; | |
import java.lang.reflect.Method; | |
/** | |
* VM options: -XX:MaxMetaspaceSize=10m | |
*/ | |
public class MethodAreaError { |
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
/** | |
* VM options: -Xss128k | |
*/ | |
public class StackOF { | |
private static int stackCount = 0; | |
private static void callMyMethod() { | |
stackCount++; | |
callMyMethod(); |
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
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* VM options: -Xms2m -Xms2m -XX:+HeapDumpOnOutOfMemoryError | |
*/ | |
public class HeapOOM { | |
static class EObject{ | |
private byte[] myBytes = new byte[200*1024]; |
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
public class MemoryAllocate { | |
private static final int _1mb = 1024*1024; | |
public static void main(String[] args) { | |
byte[] alloc1, alloc2, alloc3, alloc4; | |
alloc1 = new byte[2*_1mb]; | |
alloc2 = new byte[2*_1mb]; | |
alloc3 = new byte[2*_1mb]; | |
alloc3 = new byte[4*_1mb]; |
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
var readline = require('readline'), | |
fs = require('fs'); | |
var LinkMap = function(filePath) { | |
this.files = [] | |
this.filePath = filePath | |
} | |
LinkMap.prototype = { | |
start: function(cb) { |
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
/** | |
* leetcode_376_wiggle_sequence | |
* <p> | |
* 基本思路: | |
* <p> | |
* 首先命名两个单调序列: | |
* Growing Sequence:序列一直在变大 | |
* Declining Sequence:序列一直在变小 | |
* <p> | |
* 那么原始字符串中的最长 wiggle sequence 一定满足如下形式: |
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
// | |
// MyGLView.m | |
// OpenGL | |
// | |
// Created by Yifan on 2017/4/12. | |
// Copyright © 2017年 Yifan. All rights reserved. | |
// | |
#import "MyGLView.h" |
NewerOlder