GithubHelp home page GithubHelp logo

oldmanpushcart / greys-anatomy Goto Github PK

View Code? Open in Web Editor NEW
4.0K 4.0K 1.2K 1.73 MB

Java诊断工具

License: Apache License 2.0

Shell 2.73% Java 90.20% JavaScript 7.07%
diagnosis greys jvmti troubleshooting

greys-anatomy's People

Contributors

chengtongda avatar fnck avatar hengyunabc avatar jamespan avatar jotcmd avatar muyuqiu001 avatar neweast avatar oldmanpushcart avatar rodbate avatar tianshuang avatar yuhuifeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

greys-anatomy's Issues

给予JavaScript脚本更多规范

目前的JavaScript脚本增强不规范,不方便插件共享、加载等操作。需要规范起来,建立起javascript插件共享的氛围。

同一用户下多个jvm进程分别attach,实际attach的到都是同一个进程

使用版本是1.7.0.5
<650 linux32 [icore] : /home/icore/greys>./greys.sh 15650
ga?>jvm
+--------------------+-----------------------------------------------------------------------------------------------------+
| CATEGORY | INFO |
+--------------------+-----------------------------------------------------------------------------------------------------+
| RUNTIME | MACHINE-NAME : 15650@linux32 |

<652 linux32 [icore] : /home/icore/greys>./greys.sh 3969
ga?>jvm
+--------------------+-----------------------------------------------------------------------------------------------------+
| CATEGORY | INFO |
+--------------------+-----------------------------------------------------------------------------------------------------+
| RUNTIME | MACHINE-NAME : 15650@linux32

支持级联子类操作

背景

在对一些类进行操纵时,这些类其实是一些接口。比如我们在监听一个SayHelloService接口,其实我们希望能操纵他的实现类。

但现实是我们为了能操纵到他的子类,不得不先用sc -s进行查询

期望

相关命令在命中接口的时候,能直接操纵其所有实现类。

trace命令在处理大方法时会出现编译错误

2015-09-30 11:26:28 [ga-command-execute-daemon] WARN  greys-anatomy - transform loader[com.taobao.tomcat.container.context.loader.AliWebappClassLoader]:class[com/taobao/wmpinput/refund/service/RefundQualityChecking] failed.
java.lang.RuntimeException: Method code too large!
    at org.objectweb.asm.MethodWriter.a(Unknown Source) ~[greys-core.jar:na]
    at org.objectweb.asm.ClassWriter.toByteArray(Unknown Source) ~[greys-core.jar:na]
    at com.github.ompc.greys.core.advisor.Enhancer.transform(Enhancer.java:230) [greys-core.jar:na]
    at sun.instrument.TransformerManager.transform(TransformerManager.java:169) [na:1.6.0_32]
    at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365) [na:1.6.0_32]
    at sun.instrument.InstrumentationImpl.retransformClasses0(Native Method) [na:1.6.0_32]
    at sun.instrument.InstrumentationImpl.retransformClasses(InstrumentationImpl.java:124) [na:1.6.0_32]
    at com.github.ompc.greys.core.advisor.Enhancer.enhance(Enhancer.java:372) [greys-core.jar:na]
    at com.github.ompc.greys.core.server.DefaultCommandHandler.execute(DefaultCommandHandler.java:223) [greys-core.jar:na]
    at com.github.ompc.greys.core.server.DefaultCommandHandler.executeCommand(DefaultCommandHandler.java:87) [greys-core.jar:na]
    at com.github.ompc.greys.core.server.GaServer$4.run(GaServer.java:329) [greys-core.jar:na]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_32]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_32]
    at java.lang.Thread.run(Thread.java:662) [na:1.6.0_32]

就其原因,主要还是trace命令要在每个方法中埋点过多,遇到大方法的时候非常容易超过JVM对于method_code不能超过64K的限制

trace命令在跟踪<init>方法时出现顺序错误

在Greys的模型中,我们期待的顺序是

before() -> invokeBeforeTracing() -> invokeAfterTracing() -> afterThrowing()/afterReturning() -> afterFinishing()

但在处理<init>方法时,invokeBeforeTracing()要优先于before()方法而执行

trace命令需要输出统计摘要信息

今天trace命令输出了非常完整和详细的调用,但如果遇到for循环输出的内容就傻眼了。此时需要trace命令和monitor命令做一个结合,这个需要greys底层新提供接口。

greys.sh脚本支持新版本检测

一般很少有人主动升级greys,所以希望能在greys.sh启动过程中自动监测是否有新版本升级。
要求

  1. 检测时间越短越好
  2. 检测可以用参数关闭掉,默认开启
  3. 脚本自动完成升级动作

JavaScript引擎rhino与Javassist结合存在严重漏洞

使用Javassist进行编织的代码中,如果混入JavaScript引擎rhino所组织的代码,会引起JVM崩溃。触发的时机在YaungGC发生的时候,如果对象被GC掉,但仍然有命令在通过rhino所组织的代码访问该对象时,会引起JVM崩溃。

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0x0000000796a2a9f8, pid=11844, tid=4867
#
# JRE version: Java(TM) SE Runtime Environment (8.0_25-b17) (build 1.8.0_25-b17)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  0x0000000796a2a9f8
#
# Core dump written. Default location: /cores/core or core.11844
#
# An error report file with more information is saved as:
# /Users/vlinux/temp/hs_err_pid11844.log
Compiled method (c1)   41756 3032       3       java.lang.invoke.LambdaForm$MH/556442004::getObjectField (23 bytes)
 total in heap  [0x000000010878d010,0x000000010878d7e8] = 2008
 relocation     [0x000000010878d138,0x000000010878d188] = 80
 main code      [0x000000010878d1a0,0x000000010878d5e0] = 1088
 stub code      [0x000000010878d5e0,0x000000010878d670] = 144
 oops           [0x000000010878d670,0x000000010878d678] = 8
 metadata       [0x000000010878d678,0x000000010878d6a8] = 48
 scopes data    [0x000000010878d6a8,0x000000010878d740] = 152
 scopes pcs     [0x000000010878d740,0x000000010878d7c0] = 128
 dependencies   [0x000000010878d7c0,0x000000010878d7d0] = 16
 nul chk table  [0x000000010878d7d0,0x000000010878d7e8] = 24
^C^C^CAbort trap: 6 (core dumped)

与此同时,jstat看到的GC情况

  S0     S1     E      O      M     CCS    YGC     YGCT    FGC    FGCT     GCT    LGCC                 GCC                 
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC               
 99.68   0.00  97.73   1.93  94.35  88.62      2    0.012     1    0.009    0.020 Allocation Failure   No GC 

可以看到在触发YGC的时候,引起了错误

Greys优化通讯协议支持telnet

Greys目前通过非常重的JLine来完成命令行交互,但很多场景下其实只需要有nc、telnet命令的地方就希望能登录上来。

支持通配符表达式

背景

在进行scsm等一系列命令时,唯一绕不开的就是查询的正则表达式,但这个表达式极其难写,经常一个不小心就写错。

期望

支持通配符表达式

monitor指令存在CAS重大BUG

问题描述

在Monitor的命令中,间隔X秒对统计的内容进行输出,是通过一个CAS来完成的。但在对此次CAS的处理中,存在严重的逻辑错误,会导致一旦出现并发将会让Timer进入死循环,吃光CPU资源,导致JVM崩溃。

问题修复

本次CAS问题将会在1.5版本中进行修复

sc命令查看类详细信息可能出错的问题

sc命令使用-d参数查看类的详细信息时,由于存在类的初始化失败的可能,会导致整个命令无法完成。

纠其本质原因,因为-d命令在执行时,将所有Field进行展示,需要用另外一个参数进行隔离

Greys增加调用记录/回放功能

Greys纪录下某个方法的入参,然后通过replay命令回放这次入参调用。
record <类正则匹配> <方法正则匹配>
记录下来的格式是

IDX ClassLoader 对象地址 类名 方法名 时间戳
00 WebAppClassLoader 0x2410h ItemQueryServiceImpl queryItemById 2014-11-11 00:00:00

replay [回放次数]

在code cache快满的时候禁止使用特定命令

greys使用了动态代理技术,在code cache快满的时候使用greys倒反会给目标jvm带来非常严重的负担。所以建议在greys启动的时候检测code cache的使用情况。

java -classpath "/usr/alibaba/java/lib/tools.jar:/" CodeCacheUsage 52850

resin中无法获取Agent

微博网友 IT大卫 返回greys在resin中会抛出空指针。

  • 原因

    经过核对发现是resin在启动过程中替换掉了System.props,替换的内容随着Thread改变而改变,以此达到彻底的容器隔离效果。

    但不幸的是greys依靠System.props来传递Hook,所以一旦被替换掉之后后续就无法优雅的再次拿到。

  • 思考

    不得不承认resin的隔离机制做得真变态,但有道理。所以这里将参考HouseMD的做法,将间谍类注入到对应的ClassLoader中来规避这个问题。

JOB输出文件存在性能问题

JOB的输出为了节省内存,是通过文件进行交互的,在频繁的输出过程中存在反复写文件的问题,严重的时候会非常影响性能(比如watch/profiler一个非常热的方法),所以需要将文件的打开、关闭和session的生命周期进行挂钩,避免不必要的反复打开、关闭文件。

优化Greys的日志输出

greys目前的日志输出全部是info级别,没有debug的信息,导致很多线上问题无法进行排查。所以需要对整套日志输出进行重构,并能动态调整当前greys的日志级别

解决$Proxy代理类无法被拦截的问题

在拦截HSF的Consumer的时候,其中的方法无法被正确拦截,经过仔细排查发现是GreysAnatomyClassFileTransformer.java类中无法通过ClassLoader获取$Proxy的类,原因是ClassLoader获取$Proxy类字节码的时候是通过getReousrces()完成的,但$Proxy因为没有CodeSource,所以无法通过这样的方式完成字节码获取,需要改变获取的方式。

部分命令增加调用次数

  • watch
  • trace
  • tt
  • stack

以上四个命令为持续性命令,如果不主动按CTRL+D不会停止,现在需要增加一个命令参数,要求能指定执行次数

Greys Server是一个telnet server,不利于扩展

greys server实际上是一个telnet server,这样子好处是telnet可以直接连接上去。但是都依赖telnet,感觉比较难扩展。

比如,想做一个图形界面的客户端,显然是很困难的。

可不可以考虑做成这样子的结构?

  • agent server和client之间通过轻量级的request/response来通迅
  • 展示数据的逻辑都放在client端,client可以是一个CLI,一个GUI,甚至是一个web应用

这样子的结构扩展容易,二次开发也容易,避免很多TEXT输出的麻烦。

有时候会遇到ClassNotFoundException

OS:
mac 10.9.5

JDK
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

在用monitor的时候遇到如下错误

java.lang.ClassNotFoundException: [Lbyte[];
at java.lang.Class.forName0(Native Method) ~[na:1.7.0_71]
at java.lang.Class.forName(Class.java:274) ~[na:1.7.0_71]
at com.github.ompc.greys.advisor.ReflectAdviceListenerAdapter.toClass(ReflectAdviceListenerAdapter.java:69) ~[greys.jar:na]
at com.github.ompc.greys.advisor.ReflectAdviceListenerAdapter.toMethod(ReflectAdviceListenerAdapter.java:80) ~[greys.jar:na]
at com.github.ompc.greys.advisor.ReflectAdviceListenerAdapter.afterReturning(ReflectAdviceListenerAdapter.java:112) ~[greys.jar:na]
at com.github.ompc.greys.advisor.AdviceWeaver.afterReturning(AdviceWeaver.java:303) [greys.jar:na]
at com.github.ompc.greys.advisor.AdviceWeaver.methodOnEnd(AdviceWeaver.java:183) [greys.jar:na]
at com.github.ompc.greys.advisor.AdviceWeaver.methodOnReturnEnd(AdviceWeaver.java:136) [greys.jar:na]

Greys的JOBID为超长字符串类型性能低

    /**
     * 创建一个job
     *
     * @return
     */
    public static String createJob() {
        final String id = UUID.randomUUID().toString();
        Job job = new Job();
        job.id = id;
        job.isAlive = false;
        jobs.put(id, job);
        return id;
    }

Greys的JobId是通过UUID生成的字符串来完成,然后所有地方进行比对的时候是通过

private static final Map<String, Job> jobs = new ConcurrentHashMap<String, Job>();

jobs的一个map来完成,所以每次进行key比对的时候都是进行一个超长字符串的比对,性能开销非常高,需要在下个版本中修复这个问题。JobId的字符串比对将会是非常消耗JVM的一个开销,在profiler多的时候会严重影响到整个应用的性能,最关键的是,即使job消失后这个影响依然会持续的存在。

greys研发1.5.1版本

Greys1.5.1

BUGFIX

  1. 修复profiler命令在渲染大量类的时候会出错。
  2. 如果RMI放着太久,超过4个小时左右吧,下次再企图访问这个RMI就无法访问了,我会加上一个超时机制,超过一定的时间主动shutdown

建议代码风格切换为JDK1.8

现在很多代码都使用了大量的匿名内部类模式,导致代码非常的丑陋,所以建议代码重构为JDK1.8的形式,但编译目标仍为1.6

<configuration>
    <source>1.8</source>
    <target>1.6</target>
    <encoding>GBK</encoding>
</configuration>

Groovy语法的解析好像有点问题

watch -s com.agile.admin.security.weblogic.WLSLoginModule validate "hello"+params[0]+"/"+params[1]+"="+returnObj+":"+method
不执行("hello"字符串放在最前面就不工作),无任何输出

watch -s com.agile.admin.security.weblogic.WLSLoginModule validate params[0]+"/"+params[1]+"="+returnObj+":"+method+"hello"
正确执行

watch -s com.agile.admin.security.weblogic.WLSLoginModule validate params[0] + "/" + params[1] + "=" + returnObj + ":" + method
不执行 (字符型连接时如果有空格也不工作),无任何输出

watch -s com.agile.admin.security.weblogic.WLSLoginModule validate params[0]+"/"+params[1]+"="+returnObj+":"+method
正确执行

ga?>watch -s com.agile.admin.security.weblogic.WLSLoginModule validate method+":"+params[0]+"/"+params[1]+"="+returnObj
出现错误提示 (method放在最前面会错误)
No signature of method: com.github.ompc.greys.core.util.GaMethod.plus() is applicable for argument types: (java.lang.String) values: [:]
Possible solutions: split(groovy.lang.Closure), is(java.lang.Object), use([Ljava.lang.Object;), wait(), dump(), grep()

ga?>watch -s com.agile.admin.security.weblogic.WLSLoginModule validate params[0]+"/"+params[1]+"="+returnObj+":"+method
正确执行

Greys增加热点代码分析指令hot

Greys可以通过javassist对每行代码的编织,将每一行的热点代码标示出来。

                final CodeIterator ci = cm.getMethodInfo().getCodeAttribute().iterator();
                while( ci.hasNext() ) {
                    final int index = ci.next();
                    final int op = ci.byteAt(index);
                    final int linenum = cm.getMethodInfo().getLineNumber(index);
                    if( !set.contains(linenum) ) {
                        set.add(linenum);
                        cm.insertAt(linenum,"System.out.println(\""+linenum+"\");");
                    }
                }

命令组织
hot <类正则> <方法正则> [统计命中次数]

当统计命中次数达到后,将会输出以下内容
包路径.类名#行号#热点百分比

com.taobao.xxx.DataSource#165#18%
com.taobao.xxx.DataSource#167#16%
com.taobao.xxx.DataSource#169#6%

pom.xml里命名加上前缀?

比如这个agent/pom.xml:

    <parent>
        <groupId>com.github.ompc.greys</groupId>
        <artifactId>greys</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>
    <groupId>com.github.ompc.greys</groupId>
    <artifactId>agent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <name>agent</name>

    <build>
        <finalName>greys-agent</finalName>

改为这个?

    <parent>
        <groupId>com.github.ompc.greys</groupId>
        <artifactId>greys</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>
    <groupId>com.github.ompc.greys</groupId>
    <artifactId>greys-agent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <build>

这样子在IDE里查看项目时,显示的是greys-agent,而不是aget。这样子项目在一起,方便查看。

开发1.6.0.0版本

DEVELOP-FOR-1.6.0.0版本开发说明

面临的问题

代码太繁重

  1. 大量不优雅的代码充斥着整个工程结构
    • Utils类
    • 帮助文档类
    • Commands解析类
  2. Command应该使用MVC模型进行重构
  3. JLine的引用太失败,让整个工程增加了太多的累赘
  4. 使用RMI作为远程通讯协议,既繁重又累赘

我们的解药

  • 这些问题促使我下决心对整个Greys工程进行一次大规模的结构调整,进一步增加Grerys的原生解析部分,降低对第三方包的依赖程度。
  • 增强Command的插件化支持程度,让更多命令能优雅的集成进来

当TableView固定列大小,KVView自动列大小时,会出现TableView输出多余的空行

public class TableViewTest2 {
    public static void main(String[] args) {
        RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();

        final TableView tableView = new TableView(new TableView.ColumnDefine[]{
                new TableView.ColumnDefine(35, false, TableView.Align.RIGHT),
                new TableView.ColumnDefine(80, false, TableView.Align.LEFT)
        })
                .padding(1)
                .hasBorder(true);

        KVView kvView = new KVView(
                new TableView.ColumnDefine(TableView.Align.RIGHT),
                new TableView.ColumnDefine(TableView.Align.LEFT)
        );

        kvView.add("xxx", "yyyyyyyyyyyyyyyyyyyyyyyy");

        kvView.add("LIBRARY-PATH", runtimeMXBean.getLibraryPath());
        System.err.println("kvView.draw(), output:");
        System.err.println(kvView.draw());

        tableView.addRow("kvkv", kvView.draw());
        String table = tableView.draw();
        System.err.println("tableView.draw(), output:");
        System.err.println(table);
    }
}

出现多余的空行的原因是,KVview在输出时,会补全空格到最长的长度。所以在"yyyyy”后面会多出来很多的空格。再经过TableView的固定列处理,多余的空格就会在一行里放不下,输出成两行(第二行前面是空格)。

trace命令存在时间为负数的情况

在某些情况下,trace命令统计出来的时间竟然为负数。这种场景我只有在TreeView的begin()和end()方法没有配对的情况下才会出现,需要好好尽兴排查。

greys研发1.5版本

Greys1.5

特性

  1. 支持精简指令集
  2. 更友好的错误提示
  3. 更友好的帮助文档
  4. 支持单用户、多用户的切换

BUGFIX

  1. 修复多用户模式下多个Greys都占用3658端口的问题

monitor命令增加max/min/concurrent三个监控指标

  1. 对于实际问题排查而言,RT容易被max/min所干扰,所以需要在统计的时候需要明确标记出max/min
  2. 在排查过程中需要监控到当前方法并发进入量(在访问池化对象的时候尤其有用)

JOB输出文件格式存在扩展性问题

对JOB输出结束的判断是通过添加不可见字符END_MASK来完成

private boolean isFinish(String message) {
        return !StringUtils.isEmpty(message) ? message.endsWith(END_MASK) : false;
    }

虽然这样做也能实现目的,但遇到对字符行的控制(redraw)等需求时就会抓瞎,所以这里建议重构掉JOB文件的格式内容,提升扩展性。

GreysAnatomyClassFileTransformer类中存在内存泄漏风险

GreysAnatomyClassFileTransformer.java中定义了一个

    /*
     * 对之前做的类进行一个缓存
     */
    private final static Map<String, byte[]> classBytesCache = new ConcurrentHashMap<String, byte[]>();

用了一个HashMap缓存了之前生成的字节码,但这种做法存在无法释放内存的严重风险,随着在一个jvm上使用greys数次之后,有可能引发OOM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.