English 中文(简体)
如何追踪Oracle JRE的方法,系统.gc()
原标题:How to trace method, System.gc(), in Oracle JRE

我知道,我有一份申请,即:System.gc(Runtime.gc(。 我通过使用<条码>-XX:+可转让的GC和全部GCs消失,对此进行了核实。

我检查了该守则,似乎没有发现任何电话的<编码>System.gc(或Runtime.gc()。 它是一个大型项目,因此我有可能错失,或者在一些图书馆被叫去。

我与IBM JRE了解,你可以操作rel=“nofollow”traces

例:

-Xtrace:trigger=method{java/lang/System.gc,javadump}

是否有可能与Oracle JRE做同样的事,帮助找到被称作“谁? 我没有能力用破碎的方式来处理这个问题。

此外,我知道,它不是NIO,也不是RMI,而是这些GC电话。

问题回答

You could try using AOP to define an @Before pointcut for those methods, then create an Exception object and either throw it or log/mail it s stacktrace. Note that you could inspect the stacktrace to only take action on relevant cases (i.e. experiment a bit locally to figure out what a normal non-explicit stacktrace might look like).

你可以:

  • profile the application with e.g. jProfiler, then you can search through the collected trace to find the System.gc() calls.
  • collect thread dumps in the time when you expect a Full GC to occur, this could show you the stack trace triggering the System GC.




相关问题
Recommended way to develop using Jetty and Eclipse

I am currently developing a J2EE application and I would like to use Jetty. I would like to have iot integrated with Eclipse, so I could debug the appliaction. I ve tried out couple of plugins (...

Call function periodically in Java

we need run one function periodically in Java web application . How to call function of some class periodically ? Is there any way that call function when some event occured like high load in server ...

Why make an EJB rather than a Web Service?

I would have thought that there is a lot of information out there on this, but I haven t found anything that really answers my question. What are the advantages of making an EJB rather than a web ...

Where should I put this configuration setting?

I m designing a fairly small web application which will run on a Sun application server (v9.1). It only has a few pages, no database of its own, and will retrieve/update data via web services. There s ...

JNDI Names -- Is Prefix "jdbc/" needed?

What s up with JNDI names? I m trying to get a javax.sql.DataSource using the new annotations feature of Java 5. It s not working for me, so I want to ask... I have a in my web.xml, inside of it is ...

hibernate interceptors : afterTransactionCompletion

I wrote a Hibernate interceptor : public class MyInterceptor extends EmptyInterceptor { private boolean isCanal=false; public boolean onSave(Object entity, Serializable arg1, Object[] arg2, String[]...

热门标签