Debugging/Profing javac

Enrico Olivelli eolivelli at gmail.com
Tue Dec 4 13:58:45 UTC 2018


Il giorno mar 4 dic 2018 alle ore 14:15 Vicente Romero
<vicente.romero at oracle.com> ha scritto:
>
>
>
> On 12/4/18 1:09 AM, Enrico Olivelli wrote:
>
>
>
> Il mar 4 dic 2018, 04:04 Vicente Romero <vicente.romero at oracle.com> ha scritto:
>>
>> Hi Enrico,
>>
>> On 12/3/18 4:58 PM, Enrico Olivelli wrote:
>>
>> Hi,
>> I have a java application made of about 2000 classes, and javac take a very long time to compile the module, like more than one minute (on workstations which usually are able to compile similar projects faster).
>>
>> This is very strage and I guess there is some .java file which is making javac work more than what is needed.
>> Is there any 'profile' or 'debug' mode which prints the processing time for each file or group of files/classes ?
>>
>>
>> you will need to use an external profiler, is the code accessible in any way? is javac the only one to blame, I mean are you using maven or similar to build?
>
>
> Vicente,
>
> Unfortunately it is not opensource code.
> I can use yourkit, jvisualvm,jmc or what you suggest, but with a profiler you don't get the info to understand which files are the hotspot.
>
>
> Java Mission Control should be fine to get a global picture.

Ok, using JMC 7 (the one downloadable from openjdk website)

>
> I can share some dump, or sample  JVM stacktraces.
>
>
> yes that could help

How can I share with you the .jfr file of the recording ? Are you
interested in specific information ?
I don't know javac internals, so I can't point specific issues.

>
> For what I can understand it is not a problem about I/O.
> I am using Maven, but I am sure the problem is only the pure javac execution. I am running javac in the process as Maven, but even 'forking' javac has the same result.
> I can try to reproduce it without Maven (I can grab the command line in form mode and relaunch javac)
>
> yes removing Maven from the picture will be helpful isolating the issue.

Now I am using fork=false, so javac is a separate process and I am
able to grab a live recording.

>
>
> If there is no out of the box flag, maybe I can add some logging on javac but I need some advice about what to instrument.
>
>
> IMO adding logging could alter the results

got it
>
>
> I forgot to say that I am on linux, with latest jdk11 openjdk published build, but with jdk8 the result is pretty the same. Code is compiled with source/target = 8.
>
>
> what happens if you remove the source/target=8 provided that that is an option?

Same results

Enrico

>
>
> I am not able to track down to the commit in my code which introduced the slowdown.
>
>
> Thank you
>
> Enrico
>
>
> Vicente
>
>
>>
>>
>> Best regards
>> Enrico Olivelli
>> --
>>
>>
>> -- Enrico Olivelli
>>
>> Thanks,
>> Vicente
>
> --
>
>
> -- Enrico Olivelli
>
>


More information about the compiler-dev mailing list