Skip to content

Instantly share code, notes, and snippets.

View asafm's full-sized avatar

Asaf Mesika asafm

View GitHub Profile
@asafm
asafm / memory-test.java
Created February 29, 2016 07:21
Show resident memory behavior after releasing memory in two flavors: direct and heap
package io.logz.netty;
import java.lang.management.ManagementFactory;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
public class MemoryMain {
public static void main(String[] args) {
System.out.println("hello there - process id "+getCurrentProcessId());