goodguy
goodguy

Reputation: 3

Is there any hard limit on the JVM flags to control escape analysis?

I've been trying to understand JVM escape analyis recently. I tried a lot of combination of the JVM options according to this nice answer. My question is that is there any hard limit on thoses option values? Like FreqInlineSize, MaxInlineLevel. JVM wouldn't take it seriously when I set the options to some ridiculous value, like -XX:FreqInlineSize=65535 will it? Actually, I tried that. But jvm didn't complain about it. So I really cannot tell.

If there is some hard limit, what would that be? Where can I find the documents that describes such things?


I've been trying to find a way to force my Protobuf message and builder objects to be allocated on stack instead of on heap. Sometimes it works. But when the number of fields of the message object grows, it stopped working. I searched a lot on the internet but with little findings due to my limited understanding on the subject. So That why I am asking.


JVM version: Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Upvotes: 0

Views: 456

Answers (1)

apangin
apangin

Reputation: 98515

  • The options you mention control inlining, not the escape analysis.
  • There is no hard limit one these values, or, more precisely, the limit is INT_MAX.
  • In practice, however, inlining and other optimizations are bounded by other limits such as NodeCountInliningCutoff (not tunable), MaxNodeLimit, NodeLimitFudgeFactor etc.
  • I doubt you'll find much documentation on these things other than in source code.

Upvotes: 1

Related Questions