如何禁用sun jvm的内联优化? [英] how to disable inlining optimization with sun jvm?

查看:398
本文介绍了如何禁用sun jvm的内联优化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要做一些实验,显示内联对我的代码的影响。有谁知道如何禁用sun jvm内联?我搜索了 http://www.oracle.com/technetwork/java/javase/ tech / vmoptions-jsp-140102.html 并且了解-XX:InlineSmallCode = n可以控制内联候选者的阈值。那么-xx:InlineSmallCode = 0工作吗?

I need to do some experiments showing the effect of inlining on my code. Anybody knows how to disable inlining with sun jvm? I searched http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html and got to know -XX:InlineSmallCode=n can control the threshold of the inlining candidates. So will -xx:InlineSmallCode=0 work?

推荐答案

我会尝试 -XX:MaxInlineSize = 0 而不是。 InlineSmallCode 的描述似乎有点不清楚它是否适用于所有内联。您可能还会发现此博客文章有用,因为它解释了如何告诉JIT编译器打印有关内联方法的信息:

I would try -XX:MaxInlineSize=0 instead. The description for InlineSmallCode seems a bit unclear as to whether or not it applies to all inlinings. You might also find this blog post helpful as it explains how to tell the JIT compiler to print information about which methods are being inlined:

Java 7:如何编写真正快速的Java代码

我认为可能仍有一个例外情况,你不能禁用内联,这是完全空的方法(因为内联方法的大小仍然是0)。

I think there might still be one exception where you can't disable inlining, and that's for completely empty methods (since the inlined method size would still be 0).

这篇关于如何禁用sun jvm的内联优化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆