记录一次HSDB的使用遇到的问题 No such type.
univese Unrecognized command. Try help... hsdb> universe Heap Parameters: Gen 0: eden [0x00000000ff600000,0x00000000ff6bca68,0x00000000ff8b0000) space capacity = 2818048, 27.420114916424417 used from [0x00000000ff8b0000,0x00000000ff8b0000,0x00000000ff900000) space capacity = 327680, 0.0 used to [0x00000000ff900000,0x00000000ff900000,0x00000000ff950000) space capacity = 327680, 0.0 usedInvocations: 0 Gen 1: old [0x00000000ff950000,0x00000000ff950000,0x0000000100000000) space capacity = 7012352, 0.0 usedInvocations: 0 hsdb> scanoops 0x00000000ff600000 0x00000000ff950000 Test2 No such type. hsdb> scanoops 0x00000000ff600000 0x00000000ff950000 com.zyt.test.jvmhsdb.Test2 0x00000000ff6af668 com/zyt/test/jvmhsdb/Test2 0x00000000ff6af688 com/zyt/test/jvmhsdb/Test2 0x00000000ff6af698 com/zyt/test/jvmhsdb/Test2 hsdb>
idea中代码
public class Test { static Test2 t1 = new Test2(); Test2 t2 = new Test2(); public void fn() throws IOException { Test2 t3 = new Test2(); System.in.read(); } } class Test2 { }
Main
public class MainTest { public static void main(String[] args) throws IOException { Test test = new Test(); test.fn(); } }
设置VM参数
-XX:+UseSerialGC -Xmx10m
最重要的是要scanoops的时候加入com.zyt.test.jvmhsdb.Test2,包名否则就报找不到错误