https://www.jianshu.com/p/1ca44f94e42f
主要的几个classloader#sun.misc.Launch$ExtClassLoader#defined class 4312
com.alibaba.fastjson.util.ASMClassLoader(Deserializer_)#129
> com.alibaba.fastjson.parser.deserializer.FastjsonASMDeserializer_53_xxConfig,这里需要排查为什么所有的Config对象都被生成了反序列化的内部类?还有其他如xx_RedisConfig等(了解fastjson#asm原理即可)
com.alibaba.fastjson.serializer.ASMSerializer_70_xxConfig
这里看了代码发现有一个xxMonsterConfig,这个是在序列化到redis的时候没有加SerializerFeature.IgnoreNonFieldGetter,序列化mongo的player已经统一加上了这个feature.
system class loader#2617
Caused by: java.lang.OutOfMemoryError: Metaspace
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_40]
at java.lang.ClassLoader.defineClass(ClassLoader.java:760) ~[na:1.8.0_40]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_40]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_40]
at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_40]
at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_40]
at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_40]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_40]
at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_40]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_40]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_40]
Stack: [0x00007f03927ff000,0x00007f0392900000], sp=0x00007f03928fe340, free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0xaaca9a] VMError::report_and_die()+0x2ba
V [libjvm.so+0x4f2de9] report_fatal(char const*, int, char const*)+0x59
V [libjvm.so+0xab3d6a] VMThread::execute(VM_Operation*)+0x2ca
V [libjvm.so+0x47ecf0] CollectorPolicy::satisfy_failed_metadata_allocation(ClassLoaderData*, unsigned long, Metaspace::MetadataType)+0x150
V [libjvm.so+0x8928c5] Metaspace::allocate(ClassLoaderData*, unsigned long, bool, MetaspaceObj::Type, Thread*)+0x315
V [libjvm.so+0x8a5a26] MethodCounters::allocate(ClassLoaderData*, Thread*)+0x26
V [libjvm.so+0x89d811] Method::build_method_counters(Method*, Thread*)+0x71
V [libjvm.so+0x8a01f0] BreakpointInfo::set(Method*)+0x3a0
V [libjvm.so+0x796cd6] JvmtiBreakpoint::each_method_version_do(void (Method::*)(int))+0x56
V [libjvm.so+0xab5ac5] VM_Operation::evaluate()+0x55
V [libjvm.so+0xab3e9a] VMThread::evaluate_operation(VM_Operation*)+0xba
V [libjvm.so+0xab421e] VMThread::loop()+0x1ce
V [libjvm.so+0xab4690] VMThread::run()+0x70
V [libjvm.so+0x910ee8] java_start(Thread*)+0x108
生成的日期: Mon Sep 25 14:30:30 CST 2017
文件: D:\xx\landon\task\2017.9\server_err\java_pid16298.hprof
文件大小: 56.1 MB
字节总数: 47,508,830
类总数: 7,743
实例总数: 568,577
类加载器: 380
垃圾回收根节点: 2,703
等待结束的暂挂对象数: 0
在出现 OutOfMemoryError 异常错误时进行了堆转储
导致 OutOfMemoryError 异常错误的线程: queue-executor-handler-8
com.xx.achilles.spurs.gs.model.combat.CombatService$$Lambda$143
com.xx.achilles.spurs.gs.model.raid.daily.DailyRaidManager$$Lambda$142
com.xx.achilles.spurs.gs.model.daily.DailyManager$$Lambda$141
...
Class Name | Defined Classes | No. of Instances
------------------------------------------------------------------------------------------
sun.misc.Launcher$ExtClassLoader @ 0x800230b0 | 4,312 | 93,289
<system class loader> | 2,617 | 484,122
com.alibaba.fastjson.util.ASMClassLoader @ 0x805fd848| 129 | 129
com.alibaba.fastjson.util.ASMClassLoader @ 0x805e2858| 73 | 73
------------------------------------------------------------------------------------------
...
Class Name | Shallow Heap | Retained Heap
----------------------------------------------------------------------------------------
class sun.reflect.GeneratedMethodAccessor344 @ 0x80593e18| 0 | 568
class sun.reflect.GeneratedMethodAccessor343 @ 0x80593ee0| 0 | 568
class sun.reflect.GeneratedMethodAccessor342 @ 0x80593fa8| 0 | 568
class sun.reflect.GeneratedMethodAccessor341 @ 0x80594070| 0 | 568
class sun.reflect.GeneratedMethodAccessor340 @ 0x80594138| 0 | 568
class sun.reflect.GeneratedMethodAccessor339 @ 0x80594200| 0 | 568
class sun.reflect.GeneratedMethodAccessor338 @ 0x805942c8| 0 | 568
class sun.reflect.GeneratedMethodAccessor337 @ 0x80594390| 0 | 568
class sun.reflect.GeneratedMethodAccessor336 @ 0x80594458| 0 | 568
...
----------------------------------------------------------------------------------------
Class Name | Defined Classes | No. of Instances
----------------------------------------------------------------------------------------------------
sun.misc.Launcher$ExtClassLoader @ 0x800230b0 | 4,312 | 93,289
<system class loader> | 2,617 | 484,122
com.alibaba.fastjson.util.ASMClassLoader @ 0x805fd848 | 129 | 129
com.alibaba.fastjson.util.ASMClassLoader @ 0x805e2858 | 73 | 73
javax.management.remote.rmi.NoCallStackClassLoader @ 0x806fc4f8| 1 | 0
javax.management.remote.rmi.NoCallStackClassLoader @ 0x806fc5d0| 1 | 0
sun.reflect.DelegatingClassLoader @ 0x80593db8 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x80593e80 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x80593f48 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x80594010 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x805940d8 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x805941a0 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x80594268 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x80594330 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x805943f8 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x805944c0 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x80594588 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x80594650 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x805947c8 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x80594890 | 1 | 1
sun.reflect.DelegatingClassLoader @ 0x80594958 | 1 | 1
sun.reflect.DelegatingClassLoader @