Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (732)
Games in Android Showcase (221)
games submitted by our members
Games in WIP (806)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  ArrayList$Itr and Escape Analysis  (Read 4327 times)
0 Members and 1 Guest are viewing this topic.
Offline princec

« JGO Spiffy Duke »


Medals: 925
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Posted 2017-03-06 12:54:45 »

Can somebody settle this once and for all...

JVisualVM reports that I'm generating megabytes worth of iterators every frame. This is bothering because there are other things I'd rather have room to create megabytes of every frame. However I've heard anecdotally that it is only the presence of JVisualVM's profiling that actually causes these iterators to be picked up because it turns off the escape analysis feature in the JVM.

Could the assembled hive mind prove one way or the other that this is indeed happening (who's got a debug VM handy to print the assembly out)?

Cas Smiley

Offline princec

« JGO Spiffy Duke »


Medals: 925
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #1 - Posted 2017-03-06 13:00:05 »

(For your reference: my knowledge on the subject comes from this article but it is four years old and things change)

Cas Smiley

Offline Roquen
« Reply #2 - Posted 2017-03-06 13:13:11 »

You don't need a debug VM, just the disasm DLL (which Oracle can't distribute).  I posted a link at some point, but am unable to find it with a search (and don't have a copy ATM)

EDIT: Oh the file is 'hsdis-amd64.dll' and probably someone has a copy. 
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline nsigma
« Reply #3 - Posted 2017-03-06 13:57:03 »

Are you in a position to try / use Java Mission Control?  According to various things I've read, including the article you linked to, this can analyse without switching off escape analysis.

Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline Spasi
« Reply #4 - Posted 2017-03-06 14:06:42 »

Stop wasting your time with traditional profilers. Treat them like antivirus software; they lie all the time and they are not made to help you. Yes, they're that bad.

Can somebody settle this once and for all...

JVisualVM reports that I'm generating megabytes worth of iterators every frame. This is bothering because there are other things I'd rather have room to create megabytes of every frame. However I've heard anecdotally that it is only the presence of JVisualVM's profiling that actually causes these iterators to be picked up because it turns off the escape analysis feature in the JVM.

This is true, merely the presence of an attached profiler will disable escape analysis and many other optimizations. The simplest way to identify whether EA is kicking in or not is to use JITWatch. It's my favorite performance analysis tool these days. It doesn't require a debug VM or the disasm DLL (though disasm is highly recommended for low-level tuning). Here's a demo of the EA reporting:

<a href="http://www.youtube.com/v/LK1Ain1JDlQ?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/LK1Ain1JDlQ?version=3&amp;hl=en_US&amp;start=</a>

A debug VM will tell you why a particular allocation has not been eliminated. This is useful, but not critical for performance tuning, assuming you're familiar with the basics. Once you identify a problematic allocation, it takes a bit of refactoring to solve the problem and it's rarely an unfixable situation. Like everything else in Java, bytecode size, call depth and associated inlining decisions play the most critical role.
Offline princec

« JGO Spiffy Duke »


Medals: 925
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #5 - Posted 2017-03-06 15:43:12 »

JITWatch! Of course. I knew there was a tool I was missing but I just couldn't remember what it was. Thanks Spasi.

I've used Oracle's Mission Control thing and sure enough it's quite different in output to JVisualVM.

Cas Smiley

Pages: [1]
  ignore  |  Print  
 
 

 
Archive (399 views)
2017-04-27 17:45:51

buddyBro (585 views)
2017-04-05 03:38:00

CopyableCougar4 (1042 views)
2017-03-24 15:39:42

theagentd (1072 views)
2017-03-24 15:32:08

Rule (1048 views)
2017-03-19 12:43:22

Rule (1032 views)
2017-03-19 12:42:17

Rule (1024 views)
2017-03-19 12:36:21

theagentd (1163 views)
2017-03-16 05:07:07

theagentd (1106 views)
2017-03-15 22:37:06

theagentd (832 views)
2017-03-15 22:32:18
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!