Skip to content

Instantly share code, notes, and snippets.

View zhuyifan2013's full-sized avatar
🎯
Focusing

Yifan Zhu zhuyifan2013

🎯
Focusing
  • RockVR
  • haidian,beijing
View GitHub Profile
/**
* 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];
/**
* 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];
/**
* 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];
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 {
/**
* VM options: -Xss128k
*/
public class StackOF {
private static int stackCount = 0;
private static void callMyMethod() {
stackCount++;
callMyMethod();
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];
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];
@zhuyifan2013
zhuyifan2013 / linkmap.js
Created July 26, 2017 14:58 — forked from bang590/linkmap.js
XCode Linkmap Parser
var readline = require('readline'),
fs = require('fs');
var LinkMap = function(filePath) {
this.files = []
this.filePath = filePath
}
LinkMap.prototype = {
start: function(cb) {
/**
* leetcode_376_wiggle_sequence
* <p>
* 基本思路:
* <p>
* 首先命名两个单调序列:
* Growing Sequence:序列一直在变大
* Declining Sequence:序列一直在变小
* <p>
* 那么原始字符串中的最长 wiggle sequence 一定满足如下形式:
//
// MyGLView.m
// OpenGL
//
// Created by Yifan on 2017/4/12.
// Copyright © 2017年 Yifan. All rights reserved.
//
#import "MyGLView.h"