EscapeAnalysis diagnostics + user-guided stack allocation
vladimir.kozlov at oracle.com
Tue Jan 17 10:38:23 PST 2012
Vitaly Davidovich wrote:
> Is there a way, in product build, to get diagnostics on EA? For example,
> to see which allocations in a method are removed? I realize EA is an
> implementation detail and subject to change release to release, but it
> would be a great option to have for performance tuning. There are many
> classes which are simple wrappers on top of a primitive (e.g. Apache's
> HashCodeBuilder, EqualsBuilder) which people use, and if the allocations
> are not removed, they create a lot of GC pressure. In cases where EA
> does not remove them, it would be advantageous to hand-code the
> functionality instead of using these utility wrappers. However, the
> only way to know right now (to my knowledge) is to look at disassembly
> via hsdis -- it'd be great if there was a simpler and quicker way to do
> that check.
There is debug flag PrintEliminateAllocations. Nobody asked before to make it
available but we can change it to diagnostic flag.
> Also, are there any plans to support struct/value-type like (ala CLR's
> struct) constructs in the JVM (presumably java can then target it)? This
> would allow developer to control where something gets allocated without
> relying on EA, and it would also reduce the amount of indirection in
> object graphs (and the mem/cpu performance hit of them) since struct
> members of a heap allocated object could be allocated "inline".
> Apologies if this mailgroup isn't the most appropriate for this
> particular question, so feel free to redirect me to the right one.
I don't known about such plans. Send this question to hotspot-dev at openjdk.java.net
> 617-548-7007 (mobile)
More information about the hotspot-compiler-dev