Skip to content

Instantly share code, notes, and snippets.

View changreytang's full-sized avatar

Rey Tang changreytang

View GitHub Profile
@changreytang
changreytang / test.go
Created May 29, 2018 01:26
Memory Profiling for CGo
package main
/*
#include "lib/lib.h"
#include <stdlib.h>
#cgo LDFLAGS: -L. -llib
*/
import "C"
import (
@changreytang
changreytang / MetaspaceResearch.md
Last active July 12, 2022 03:38
Research the impacts of the replacement of PermGen with Metaspace from JDK7 to JDK8

Metaspace Research

What is PermGen?

  • The Permanent Generation memory pool contains permanent class metadata and descriptors information when classes are loaded
    • PermGen space is always reserved for classes and items that are attached to them (i.e., static members)
  • PermGem space is contiguous in memory to the Java heap and have the same rounds of Garbage Collection but it is not part of the Java heap

What is Metaspace?

  • In JDK8, the PermGen space has been entirely replaced by Metaspace which is no longer contiguous to the Java heap and now exists in native memory